Re: [xsl] commenting Parent element only

Subject: Re: [xsl] commenting Parent element only
From: "Christopher R. Maden" <crism@xxxxxxxxx>
Date: Sat, 18 Sep 2010 13:01:50 -0400
pankaj.c@xxxxxxxxxxxxxxxxxx wrote:
> Just to add I am processing the child entry element later.

Donbt do that, then.

Your stylesheet instructs the processor to do the entire comment first,
then do the content.  Thatbs what you are getting.

You need to do something more like:

<xsl:template match="row">
  <xsl:comment>
    <xsl:value-of select="'&lt;'"/>
    <xsl:value-of select="name()"/>
    <xsl:text> </xsl:text>
    <xsl:apply-templates select="@*" mode="comment_element" />
    <xsl:value-of select="'&gt;'"/>
  </xsl:comment>
  <xsl:apply-templates/>
  <xsl:comment>
    <xsl:value-of select="'&lt;/'"/>
    <xsl:value-of select="name()"/>
    <xsl:value-of select="'&gt;'"/>
  </xsl:comment>
</xsl:template>

~Chris
--
Chris Maden, text nerd  <URL: http://crism.maden.org/ >
bI like being free, and that makes me an idiot, I suppose.b
  b Stan Rogers, bThe Idiotb
GnuPG Fingerprint: C6E4 E2A9 C9F8 71AC 9724 CAA3 19F8 6677 0077 C319

Current Thread