This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: XSL to Sort XML Doc return XML Doc ?


<xsl:template match="records">
  <xsl:copy>
  <xsl:for-each select="*"><xsl:sort select="."/>
    <xsl:copy-of select="."/>
  </xsl:for-each>
  </xsl:copy>
</xsl:template>

Mike Kay
Software AG

> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Hasselback,
> Matt
> Sent: 31 May 2001 19:18
> To: xsl-list@lists.mulberrytech.com
> Subject: [xsl] XSL to Sort XML Doc return XML Doc ?
> 
> 
> Hello...
>  
> I'm aiming to sort an xml document, and return the same xml 
> document, in
> its sorted transformation.  Is there an easy way to go about 
> doing this?
>  
> Example:
>  
> <records>
>             <record>B</record>
>             <record>H</record>
>             <record>A</record>
>             <record>D</record>
>             <record>C</record>
>             <record>G</record>
>             <record>F</record>
>             <record>E</record>
> </records>
>  
> return:
>  
> <records>
>             <record>A</record>
>             <record>B</record>
>             <record>C</record>
>             <record>D</record>
>             <record>E</record>
>             <record>F</record>
>             <record>G</record>
>             <record>H</record>
> </records>
>  
> Thanks for any help ...
> -Matt
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]