xsl-list
[Top] [All Lists]

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

2006-09-22 11:21:55

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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--