Subject: Re: [xsl] xsl:output method="xml" From: Mukul Gandhi <mukulw3@xxxxxxxxx> Date: Wed, 30 Jul 2003 09:06:42 -0700 (PDT) |
Please try the following XSL <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="ROWSET"> <ROWSET> <xsl:for-each select="ROW"> <xsl:sort select="value" data-type="number"/> <ROW rownum="{position()}"> <value> <xsl:value-of select="value"/> </value> </ROW> </xsl:for-each> </ROWSET> </xsl:template> </xsl:stylesheet> Regards, Mukul --- "Frank J. Buono" <Frank.Buono@xxxxxxxxxxxxxxxxxxxxxxx> wrote: > > I've seen a lot of examples of outputing in HTML; > however, > I'd like to sort on "value" and output in XML - see > input and > desired output XML below. > > Can anybody help with what my stylesheet should look > like? > > Thanks. > > Frank > p.s., I'll be doing this within java code. > > ****Input: > <ROWSET> > <ROW rownum="1"> > <value>3</value> > </ROW> > <ROW rownum="2"> > <value>1</value> > </ROW> > <ROW rownum="3"> > <value>2</value> > </ROW> > </ROWSET> > > *****Output: > <ROWSET> > <ROW rownum="1"> > <value>1</value> > </ROW> > <ROW rownum="2"> > <value>2</value> > </ROW> > <ROW rownum="3"> > <value>3</value> > </ROW> > </ROWSET> > > > XSL-List info and archive: > http://www.mulberrytech.com/xsl/xsl-list > __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] xsl:output method="xml", Frank J. Buono | Thread | [xsl] traversing to next Element, sundar k rajan |
RE: [xsl] Global variables, Andrew Welch | Date | AW: [xsl] Passing HTML to template, Markus Abt |
Month |