[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Re;[xsl] Preseving xhtml tags during a transform


Subject: Re: [xsl] Re;[xsl] Preseving xhtml tags during a transform
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 22 Sep 2006 19:21:35 +0100

> My desired outcome is that the <span class=it> and </span> tags are 
> preserved.

don't mention the T-word on this list! xslt has no access to the tags in
the document (they are not reported by the xml parser) so can not
preserve them. What it can do is (if the result tree is serialised)
produce some tags that generate equivalent elementswhen parsed.

<xsl:value-of select="text"/>

value-of produces the string value of a node (ie it removes all
elements, and just returns the character data) you want apply-templates
not value of, if you don't apply templates to the nodes, your template
that copies them won't be applied.

something like
<xsl:template match="popup">
<li>
<a href="../popups/{link}"><xsl:apply-templates mode="xh" select="text/node()"/></a>
</li>
</xsl:template>

David


Current Thread
Keywords