xsl-list
[Top] [All Lists]

Re: [xsl] applying code from inside the comment

2007-01-16 15:21:43
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>



--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>