Subject: RE: [xsl] <xsl:element> Problem From: "Michael Kay" <mhkay@xxxxxxxxxxxx> Date: Fri, 7 Sep 2001 14:06:51 +0100 |
You have chosen output method="text", although you say you want the output to be XML. Switch to method="xml" and all should be well. Mike Kay > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Dev > Chandramani > Sent: 07 September 2001 12:55 > To: XSL List > Subject: [xsl] <xsl:element> Problem > > > Hi, > > I am fairly new to XSL so my apologies if I am missing > something obvious. > I am trying to use XSL to output XML - sounds simple enough. > > My example XML input document is : > > <?xml version="1.0"?> > > <test> > <num>11</num> > <num>22</num> > <num>33</num> > </test> > > And my XSL stylesheet is : > > <?xml version='1.0'?> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > version="1.0"> > > <xsl:strip-space elements = "*" /> > <xsl:output method="text" indent="no" encoding="utf-8"/> > > <xsl:template match="/"> > > <xsl:for-each select="//num"> > > <xsl:element name="new-num"><xsl:value-of > select="."/></xsl:element> > <xsl:text>
</xsl:text> <!-- output new line --> > > </xsl:for-each> > > </xsl:template> > > </xsl:stylesheet> > > So what I expect the output to be like would be : > > <new-num>11</new-num> > <new-num>22</new-num> > <new-num>33</new-num> > > But instead I'm getting : > > 11 > 22 > 33 > > So it seems the <new-num> tags aren't being correctly outputted. > Even if I change the line that outputs the tags to be the following : > > <new-num><xsl:value-of select="."/></new-num> > > I stil get the incorrect output. > > I am using the xalan and xerces jar files from xalan version > 2.2.D9 and jdk > 1.3.1 > Any help would be greatly appreciated. > > Thanks in advance. > > Dev. > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] <xsl:element> Problem, Dev Chandramani | Thread | RE: [xsl] <xsl:element> Problem, Sullivan, Dan |
RE: [xsl] Integrating SAX filters p, Michael Kay | Date | Re: [xsl] XSLT browser support, Mitch C. Amiano |
Month |