[
Lists Home |
Date Index |
Thread Index
]
- From: Wayne Steele <xmlmaster@hotmail.com>
- To: desimonp@iname.com, xml-dev@xml.org
- Date: Tue, 03 Oct 2000 14:10:27 -0700 (PDT)
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@iname.com
>To: xml-dev@xml.org
>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.
|