Remove-Default-Attributes.xslt

Summary
This is a straightforward XSLT stylesheet for removing the default attributes from a TEI document. These are often provided by the DTD or schema, and can clutter up viewing of them.

Add any comments to the 'discussion' tab.

Required Input
While this may work on other documents it assumes a TEI Lite P4 XML document.

Expected Output
Same document, but with default attributes removed if they have the default values.

Known Restrictions or Problems
It only works on TEI P4 documents, and is not namespace-aware, but seems to work fine on these.

Stylesheet


             

 <xsl:if test="not( . = 'yes' )"> <xsl:attribute name="TEI"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template>  <xsl:if test="not( . = 'yes' )"> <xsl:attribute name="anchored"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template>  <xsl:if test="not( . = '1' )"> <xsl:attribute name="cols"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template>  <xsl:if test="not( . = 'NO' )"> <xsl:attribute name="default"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template>  <xsl:if test="not( . = 'unspecified' )"> <xsl:attribute name="direct"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template>  <xsl:if test="not( . = 'TEI.2' )"> <xsl:attribute name="doctype"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template>  <xsl:if test="not( . = 'ROOT' )"> <xsl:attribute name="from"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template>  <xsl:if test="not( . = 'uniform' )"> <xsl:attribute name="org"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template>  <xsl:if test="not( . = 'N' )"> <xsl:attribute name="part"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template>  <xsl:if test="not( . = 'unspecified' )"> <xsl:attribute name="place"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template>  <xsl:if test="not( . = 'editor' )"> <xsl:attribute name="role"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template>  <xsl:if test="not( . = 'data' )"> <xsl:attribute name="role"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template>  <xsl:if test="not( . = '1' )"> <xsl:attribute name="rows"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template>  <xsl:if test="not( . = 'complete' )"> <xsl:attribute name="sample"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template>  <xsl:if test="not( . = 'unremarkable' )"> <xsl:attribute name="status"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template>  <xsl:if test="not( . = 'unknown' )"> <xsl:attribute name="status"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template>  <xsl:if test="not( . = 'new' )"> <xsl:attribute name="status"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template> <xsl:template match="xref/@targOrder | ptr/@targOrder | ref/@targOrder | xptr/@targOrder"> <xsl:if test="not( . = 'U' )"> <xsl:attribute name="targOrder"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template> <xsl:template match="xref/@to | xptr/@to"> <xsl:if test="not( . = 'DITTO' )"> <xsl:attribute name="to"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template> <xsl:template match="titlePart/@type"> <xsl:if test="not( . = 'main' )"> <xsl:attribute name="type"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template> <xsl:template match="list/@type"> <xsl:if test="not( . = 'simple' )"> <xsl:attribute name="type"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template> <xsl:template match="teiHeader/@type"> <xsl:if test="not( . = 'text' )"> <xsl:attribute name="type"> <xsl:value-of select="."/> </xsl:attribute> </xsl:if> </xsl:template> </xsl:stylesheet>

- dating - dating sites - dating services - adult dating - dating women - brunette - brunettes - busty brunettes - sexy brunette - gay escorts - gay - teens - amateurs - teen girls - teen sex - teen - teens - teen lesbian - sexy teens - teen porn - teen pussy - teen models - hot teens - teen lesbians - nude teens - teens for cash - teen titans hentai - teen sexuality - naked teens - teen model - tiffany teen - teen titans - teen thongs - preteens have sex - hot teen girls - teen kelly - anal teen - teen ass - teen lesbians have sex - young teens - teen boys - girl teens posing in bras - teen girls - teen sex - teen - teens - teen lesbian - sexy teens - teen porn - teen pussy - teen models - hot teens - teen lesbians - nude teens - teens for cash - teen titans hentai - teen sexuality - naked teens - teen model - tiffany teen - teen titans - teen thongs - pre teens have sex - hot teen girls - teen kelly - anal teen - ass teen - teen ass - teen lesbians have sex - young teens - teen boys - girl teens posing in bras - asian - asian porn - asian girls - asian sex - asian pussy - asian lesbians - asians - asianschoolgirl - asian women - asian anal - asian - asian porn - asian girls - asian sex - asian pussy - asian lesbians - asians - asian school girls - asian women - asian anal - asian porn - asian girls - asian sex - asian-pussy - asian lesbians - asians - asian school girls - asian women - asian anal - asian - asian porn - asian girls - asian sex - asian pussy - asian lesbians - asians - asian school girls - asian women - asian anal - asian - asian porn - asian girls - asian sex - asian pussy - asian lesbians - asians - asian school girls - asian women - asian anal