Re: [xsl] applying code from inside the comment

Subject: Re: [xsl] applying code from inside the comment
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 16 Jan 2007 22:21:21 GMT
Wendell

> Note, however, that this still doesn't ensure it'll always work. If 
> your comments are broken, they might be really broken ... for example

ah but that might not be broken, it might even be valid, just not XML,
in which case all you need is a different parser. tag soup if you are
sensible or for people on this list who'd obviously prefer something
written in xslt than java...



<x>

<!--

<a>Here's my comment

-->

</x>


<xsl:stylesheet version="2.0" 
		      xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
			xmlns:d="data:,dpc"
			exclude-result-prefixes="d">
  

<xsl:import href="http://www.dcarlisle.demon.co.uk/htmlparse.xsl"/>

<xsl:template match="x">
<x>
  <xsl:apply-templates/>
</x>
</xsl:template>

<xsl:template match="comment()">
  <xsl:sequence select="d:htmlparse(.,'',true())"/>
</xsl:template>

</xsl:stylesheet>



$ saxon8 comment.xml comment.xsl
<?xml version="1.0" encoding="UTF-8"?><x>



<a>Here's my comment

</a>

</x>

Current Thread