[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: "Tracey Zellmann" <tracey.zellmann@xxxxxxxxxxx>
Date: Fri, 22 Sep 2006 14:39:10 -0400

Thank you very much! Works fine

I think there is a love-hate relationship with the T-word.
Without T's, there wouldn't be anything to transform!
Enough to make me chuckle.

No more mention of the dreaded T-word.

----- Original Message ----- From: "David Carlisle" <davidc@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, September 22, 2006 2:21 PM
Subject: Re: [xsl] Re;[xsl] Preseving xhtml tags during a transform




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