Le 27/09/2018 à 05:46, Jacob Champion a écrit :
On Wed, Sep 26, 2018, 3:32 PM Christophe JAILLET <christophe.jail...@wanadoo.fr <mailto:christophe.jail...@wanadoo.fr>> wrote:


    Well, after some tests, Xalan needs <fun:function, but Saxon needs
    <xsl:function !


The choice of 'func' over 'xsl' isn't arbitrary; I've used the name 'func' for the EXSLT Functions namespace. It's defined at the top.

Does Saxon have (compliant) support for EXSLT? (I'm not at my laptop to check, sorry.)

--Jacob

In fact, I did some testing to confirm the docs found.

Xalan is XSLT 1.0 and implement the EXSLT functions.
Saxon is XSLT 3.0. See [1] in the Saxon documentation, especially the last paragraph: "EXSLT extensions that overlap XSLT 2.0 functionality have sometimes been retained in cases where they have no impact on the Saxon core code, but in cases (such as |func:function|) where the semantics are inconveniently different from XSLT 2.0, they have been withdrawn."

So, if we want to use either XSLT engine, we should avoid this functionality.

When parsing with Saxon, a lot of warnings are generated.
Most of them are related to the inner "apply-templates", in (common.xsl, line 1297):

    <xsl:template match="@*">
    <xsl:copy>
        <xsl:apply-templates select="@*|text()" />
    </xsl:copy>
    </xsl:template>

Saxon reports that it can never match, because the match="@*" will return only attribute nodes, which can't have any attributes or child.

I'll try to fix this kind of warnings. To do that, I'll compare the output generated by Xalan before and after the fix of each warning spotted by Saxon. Even if we never make the switch to Saxon, the less useless code in the xslt stylesheet, the more readable it is.

CJ


[1]: https://www.saxonica.com/html/documentation/extensions/functions/exslt.html


Reply via email to