|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: XSLT Sort - returning attributes
> Basically from the above example, " <xsl:apply-templates
> select="*"/> " will
> return me all the elements of the book node, however I also
> want to retrieve
> all attributes.
> I 've tried " <xsl:apply-templates select="@*"/> " to get all
> attributes, but obviously Im doing something wrong.
> Is there any simpler way of going about sorting an xml doc
> and returning
> the entire document in XML format (only sorted) ?
The identity transformation is...
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
You could do a template for the root something like this...
<xsl:template match="/">
<xsl:apply-templates select="node() | @*">
<xsl:sort select="node whose value you want to use in sort"/>
</xsl:apply-templates>
</xsl:template>
Add in the identity template and you're away in a hack.
Cheers,
Dave.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








