Subject: Re: [xsl] Sorting help From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Wed, 23 May 2007 16:27:29 +0200 |
<xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()" /> </xsl:copy> </xsl:template>
Cheers, -- Abel Braaksma
I need help sorting XML file. This is the XSLT I am using. I am trying to sort the PIPTransaction based on Usage tag, UsagePurpose. UsagePurpose="Cancel" transaction should be at the starting of the file and than rest of the transaction. Thanks In advance.
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:pd="http://www.oeb.gov.on.ca" exclude-result-prefixes="pd">
<xsl:template name="Usage">
<xsl:apply-templates mode="copynode"/>
</xsl:template>
<xsl:template match="@*" mode="copynode">
<xsl:copy>
<xsl:apply-templates select="@*" mode="copynode"/>
<xsl:apply-templates mode="copynode"/> <xsl:for-each select="pd:Usage">
<xsl:sort select="@UsagePurpose" order="descending" data-type="text"/>
</xsl:for-each>
</xsl:copy>
</xsl:template>
<xsl:template match="*" mode="copynode">
<!--xsl:element name="{local-name()}" namespace=""-->
<xsl:element name="{local-name()}">
<xsl:apply-templates select="@*" mode="copynode"/>
<xsl:apply-templates mode="copynode"/> </xsl:element>
</xsl:template>
</xsl:stylesheet>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Sorting help, David Carlisle | Thread | RE: [xsl] Sorting help, Bjorndahl, Brad |
Re: [xsl] Sorting help, David Carlisle | Date | RE: [xsl] Sorting help, Bjorndahl, Brad |
Month |