[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsl:output method="xml"
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
|
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
|