xsl-list
[Top] [All Lists]

RE: RE: xsl:output method=xml

2003-07-30 11:40:36
Use the <xsl:copy-of> element. In the template below, change this line:
<ROW rownum="{(_at_)rownum}"><value><xsl:value-of select="." /></value></ROW>

to:
<xsl:copy-of select="." />
-- 
Charles Knell
cknell(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     "Frank J. Buono" 
<Frank(_dot_)Buono(_at_)ExceptionalSoftware(_dot_)com>
Sent:     Wed, 30 Jul 2003 13:42:46 -0400
To:       <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject:  RE: [xsl] xsl:output method=xml


Thanks, Charles and Mukul. That code works great!
I was under the mistaken impression that "output method=xml"
would give me more XML tags of output.

I ultimately need to have my output XML look exactly
the same as my input XML but with the rows sorted column. Each
row could have several columns.

Is there a generic stylesheet example available that simply
passes everything through?

Thanks.

frank

<?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" indent="yes" encoding="UTF-8" />
  <xsl:template match="/">
    <xsl:apply-templates />
  </xsl:template>

  <xsl:template match="ROWSET">
    <ROWSET>
    <xsl:for-each select="ROW">
      <xsl:sort select="value" data-type="number" order="ascending" />
      <ROW rownum="{(_at_)rownum}"><value><xsl:value-of select="." 
/></value></ROW>
    </xsl:for-each>
    </ROWSET>
  </xsl:template>
</xsl:stylesheet>
-- 
Charles Knell
cknell(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     "Frank J. Buono" 
<Frank(_dot_)Buono(_at_)ExceptionalSoftware(_dot_)com>
Sent:     Wed, 30 Jul 2003 10:02:07 -0400
To:       <XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject:  [xsl] xsl:output method="xml"


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




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>