[xslt] Re: XSLT questions/issues

Hi, Daniel and All!

Recently I got few questions about using LibXML + LibXSLT vs Xerces or 
Since I am not familiar enough with LibXSLT it'll be great if someone 
can answer
these LibXSLT questions (see below).

Thank you in advance,


>2) My XSLT templates have explicit support for copying XML comments through
>to the output. This works with MSXML and Xalan but comments get dropped with
>you XSLT. Is this a configuration or other option or does your DOM just
>ignore comments (as it's allowed to do, but not required to do, by the spec
>-- but which is inconvenient from my perspective). 
>3) Your XSLT appears to want an explicit root match as the first template.
><xsl:template match='/'>
>        <xsl:apply-templates select="@* | node()"/>
><xsl:template match='/Keys'>
>        <xsl:copy>
>        <xsl:apply-templates select="@* | node()"/>
>        </xsl:copy>
>... other templates ...
><xsl:template match="@* | node()" priority="-10">
>        <xsl:copy-of select="."/>
>And with input XML whose root begins:
> ... other XML
>Your XSLT, MSXSL, and Xalan XSLT all process the above script and generate
>essentially the same output. If I delete the first three lines however (the
>match='/'), then MSXSL and Xalan are both still happy but your XSLT matches
>"/" against the final template, i.e., the verbose output shows:
>Registering global variables from transform2.xsl
>xsltProcessOneNode: applying template '@* | node()' for /
>xsltCopyOf: select .
>xsltCopyOf: result is a node set
>What is the reasoning behind this behavioral difference? The MSXSL/Xalan
>behavior appears to be correct as I read the books and samples I have but
>I'm far from an expert in XSLT so what's the cause of the incompatibility

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]