|
Subject: Re: [xsl] How to get comments to indent on their own line in XML output? From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Tue, 08 Jul 2008 09:43:37 -0400 |
What interests me is the least inelegant way of doing this "by hand", as you mention.
<xsl:template name="make-comment">
<xsl:param name="content" select="''"/>
<xsl:text>
</xsl:text>
<xsl:comment>
<xsl:value-of select="$content"/>
</xsl:comment>
<xsl:text>
</xsl:text>
</xsl:template><xsl:call-template name="make-comment">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template><xsl:template name="make-comment">
<xsl:param name="content" select="''"/>
<xsl:text>
</xsl:text>
<xsl:for-each select="ancestor::*">
<xsl:text> </xsl:text>
</xsl:for-each>
<xsl:comment>
<xsl:value-of select="$content"/>
</xsl:comment>
<xsl:text>
</xsl:text>
</xsl:template>Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] How to get comments to in, Andrew Welch | Thread | [xsl] Passing HTML elements to a Te, Mark Anderson |
| Re: [xsl] Copy results, Steven Ericsson-Zeni | Date | Re: [xsl] Copy results, Wendell Piez |
| Month |