[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Problem with sorting data within an xml using XSL

  • From: Wayne Steele <xmlmaster@h...>
  • To: desimonp@i..., xml-dev@x...
  • Date: Tue, 03 Oct 2000 14:10:27 -0700 (PDT)

sorting xml using xsl
Peter:

   Step 1: can you perform any XSLT transform on an XML document?

   Your method call:

      var newXML = OriginalXML.transferNode("xslfile.XMLDocument");

   is not going to work. Try this first:

      alert( OriginalXML.transformNode(XSLdocument) );

   Once you get this to work, you can worry about

      step 2: can you put the result of an XSLT tranform into a new XML 
document, and
      step 3: how can I get this to sort right?

-Wayne Steele



>From: desimonp@i...
>To: xml-dev@x...
>Subject: Problem with sorting data within an xml using XSL
>Date: Sun, 01 Oct 2000 18:30:27 -0400 (EDT)
>
>
> > 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

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.