This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: comments
- To: xsl-list at lists dot mulberrytech dot com
- Subject: RE: [xsl] comments
- From: bryan dot s dot schnabel at exgate dot tek dot com
- Date: Wed, 19 Sep 2001 16:36:25 -0700
- Reply-To: xsl-list at lists dot mulberrytech dot com
Kevin,
Without seeing samples of what you're trying to do, I'm guessing you're
trying to use <xsl:element. . . inside <xsl:comment. . .
Maybe for
<Fruit>
<apple>Red</apple>
<tangerine>Orange</tangerine>
<grape>White</grape>
</Fruit>
You're trying to do something like
<xsl:template match="Fruit">
<xsl:for-each select="*">
<xsl:comment>
<xsl:element name="{.}">
<xsl:value-of select="name()" />
</xsl:element>
</xsl:comment>
</xsl:for-each>
</xsl:template>
And you're right. That will produce an error. <xsl:comment only produces
text nodes
If you have to, you can do this
<xsl:template match="Fruit">
<xsl:for-each select="*">
<xsl:text disable-output-escaping="yes"><!--</xsl:text>
<xsl:element name="{.}">
<xsl:value-of select="name()" />
</xsl:element>
<xsl:text disable-output-escaping="yes">--></xsl:text>
</xsl:for-each>
</xsl:template>
To get this
<!--<Red>apple</Red>-->
<!--<Orange>tangerine</Orange>-->
<!--<White>grape</White>-->
Bryan
-----Original Message-----
From: Kevin_Gutch@mapinfo.com [mailto:Kevin_Gutch@mapinfo.com]
Sent: Wednesday, September 19, 2001 1:42 PM
To: xsl-list@lists.mulberrytech.com
Subject: [xsl] comments
I want to insert XSL:Elements inside XSL:Comments. I am getting an error
when trying to do this.
Not sure why this isn't acceptable. What is the rule for this? If it is
illegal why? I could manually comment out some elements of an xml without
removing their tags.
Thanks in advance.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list