Question

I'm trying to incorporate xsl:fallback into my stylesheets. I am using Saxon9.5.1.23-HE.

I tried this code in a named template that I'm calling:

<xsl:newstuff>
    <xsl:text>blabla</xsl:text>
    <xsl:fallback>
       <xsl:message>
          Fallback worked!
       </xsl:message>
    </xsl:fallback>
</xsl:newstuff>

But instead of "Fallback worked", I get the message that the element newstuff is unkown.

Am I doing something wrong or does it have to do with the version of Saxon I am using?

I havent found anything on the Saxon website yet.

Thanks for your help!

Était-ce utile?

La solution

<xsl:fallback> is only processed in forwards-compatible mode when the version="..." on the xsl:stylesheet element is greater than the maximum version supported by the processor in question (i.e. "I only understand XSLT 2.0 but this stylesheet is 4.0, so I'll give you the benefit of the doubt"). If the processor understands the version of XSLT that you claim for your stylesheet then it is correct to reject elements it does not recognise rather than using the fallback ("I understand XSLT 2.0, this stylesheet is 2.0, therefore I know for certain that this element is wrong").

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top