|
Description:
Some XML sources contain HTML fragments which simply need copying from the source into the output. Here is the essential idea.
Source: Text Source
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template match = "html">
<xsl:copy-of select="* |text()"/>
<br/>
</xsl:template>
</xsl:stylesheet>
<?xml-stylesheet type="text/xsl" href="essential.xsl"?>
<emailLinks>
<emailLink>
<html>
<a href="mailto:bonzo@hotmail.com">Bonzo</a>
</html>
</emailLink>
<emailLink>
<html>
<a href="mailto:eliza@hotmail.com">Eliza</a>
</html>
</emailLink>
</emailLinks>
The license for this recipe is available here.
Discussion:
This recipe is drawn from an example that is supplied in the Microsoft "XSLT Samples Viewer 1.0," which is available free as a download. Incidentally, I find this an extremely useful source, even if many of the descriptions of the codes seem nearly unintelligible to mere mortals such as myself.
|