Newby, using [so-to-speak] XSLT 2.0, Saxon, Oxygen, on Windows Vista. When I
do a sort, I lose the attribute names and values unless I include a specific
template matching elements that have attributes (see listing 2). When I use
the styles sheet in listing 1, I get the concatenated value of the
attributes within the start tag, but not the attribute names as in <Cat
135> instead of <Cat pofis="1" pofis-number="35">. Is there a simpler design
than Listing 2?
Listing 1.
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates>
<xsl:sort select="Article/Year" />
<xsl:sort select="Article/IssueNumber" data-type="number" />
<xsl:sort select="Article/Page" data-type="number" />
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
Listing 2.
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates>
<xsl:sort select="Article/Year" />
<xsl:sort select="Article/IssueNumber" data-type="number" />
<xsl:sort select="Article/Page" data-type="number" />
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match="Person">
<xsl:element name="Person">
<xsl:if test="@is-author">
<xsl:attribute name="is-author">
<xsl:value-of select="@is-author" />
</xsl:attribute>
</xsl:if>
<xsl:value-of select="."></xsl:value-of>
</xsl:element>
</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>
--~--