|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Problem with sorting data within an xml using XSL
> Say I have the following:
> <xml id="OriginalXML">
> <root>
> <Sub_Root_Node>
> <Row field1="value1" field2="value2" />
> <Row field1="value1" field2="value2" />
> <Row field1="value1" field2="value2" />
> <Row field1="value1" field2="value2" />
> <Row field1="value1" field2="value2" />
> <Row field1="value1" field2="value2" />
> </Sub_Root_Node>
> </root>
> </xml>
> <xml id="xslfile" src="filexsl.xsl"></xml>
>
> I want to rebuild the XML, but have it sorted based field1, if it wasn't
> sorted at all or it was sorted on field2. What am I missing? I am using:
> var newXML = OriginalXML.transferNode("xslfile.XMLDocument");
>
> newXML is blank and newXML.xml is undefined...
>
> I tried the following: fileXSL.xsl
>
> <?xml version="1.0"?>
> <xsl:output method="xml"/>,
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
> <xsl:template match="/">
> <root>
> <Sub_Root_Node>
> <xsl:apply-templates select="Sub_Root_Node" />
> </Sub_Root_Node>
> </root>
> </xsl:template>
> <xsl:template match="Sub_Root_Node">
> <xsl:for-each select="Row" order-by="lmfLateDateCount">
> <Row
> field1="<xsl:value-of select="@field1" />"
> field2="<xsl:value-of select="@field2" />"
> />
> </xsl:for-each>
> </xsl:template>
> </xsl:stylesheet>
>
> Peter
>
>
>
>
>
>
>
--
++++++++++++++++++++++++++++++++++++++++++++++
Peter DeSimone
Email Address: desimonp@i...
New Email Address: peter@d...
Web Address: Http://www.bigfoot.com/~desimonp
New Web Address: http://www.peter.desimone.com
ICQ: 20177836
AOL Instant Messenger: Peterdesi1
++++++++++++++++++++++++++++++++++++++++++++++
---------------------------------------------------
Get free personalized email at http://www.iname.com
|
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








