xsl-list
[Top] [All Lists]

[xsl] Normalizing Whitespace When Not Using "xsl:value-of"

2013-02-21 12:03:41
Is it possible to remove whitespace when inserting values without
using xsl:value-of?

This is my template. It outputs HTML meta tags, but I can't figure out
how to normalize the space when not using xsl:value-of. I'm using xslt
1.0.

Many thanks,
Nathan

<xsl:template name="metadata">
<meta http-equiv="Content-Type" name="dc.title"
content="{eadheader/filedesc/titlestmt/titleproper}"/>
<meta http-equiv="Content-Type" name="Description"
content="{/ead/archdesc[1]/did[1]/abstract[1]}"/>
<meta http-equiv="Content-Type" name="dc.description"
content="{/ead/archdesc[1]/did[1]/abstract[1]}"/>
<meta http-equiv="Content-Type" name="dc.author"
content="{archdesc/did/origination}"/>
<meta http-equiv="Content-Type" name="lastMod" content="current-dateTime()"/>

<xsl:for-each select="//controlaccess/persname | //controlaccess/corpname">
<xsl:choose>
<xsl:when test="@encodinganalog='600'">
<meta http-equiv="Content-Type" name="dc.subject" content="{.}"/>
<meta http-equiv="Content-Type" name="subject" content="{.}"/>
</xsl:when>
<xsl:when test="//@encodinganalog='610'">
<meta http-equiv="Content-Type" name="dc.subject" content="{.}"/>
<meta http-equiv="Content-Type" name="subject" content="{.}"/>
</xsl:when>
<xsl:when test="//@encodinganalog='611'">
<meta http-equiv="Content-Type" name="dc.subject" content="{.}"/>
<meta http-equiv="Content-Type" name="subject" content="{.}"/>
</xsl:when>
<xsl:when test="//@encodinganalog='700'">
<meta http-equiv="Content-Type" name="dc.contributor" content="{.}"/>
<meta http-equiv="Content-Type" name="subject" content="{.}"/>
</xsl:when>
<xsl:when test="//@encodinganalog='710'">
<meta http-equiv="Content-Type" name="dc.contributor" content="{.}"/>
<meta http-equiv="Content-Type" name="subject" content="{.}"/>
</xsl:when>
<xsl:otherwise>
<meta http-equiv="Content-Type" name="dc.contributor" content="{.}"/>
<meta http-equiv="Content-Type" name="subject" content="{.}"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:for-each select="//controlaccess/subject">
<meta http-equiv="Content-Type" name="dc.subject" content="{.}"/>
<meta http-equiv="Content-Type" name="subject" content="{.}"/>
</xsl:for-each>
<xsl:for-each select="//controlaccess/geogname">
<meta http-equiv="Content-Type" name="dc.subject" content="{.}"/>
<meta http-equiv="Content-Type" name="subject" content="{.}"/>
</xsl:for-each>

<meta http-equiv="Content-Type" name="dc.title"
content="{archdesc/did/unittitle}"/>
<meta http-equiv="Content-Type" name="dc.type" content="text"/>
<meta http-equiv="Content-Type" name="dc.format" content="manuscripts"/>
<meta http-equiv="Content-Type" name="dc.format" content="finding aids"/>

</xsl:template>

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>