質問

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!

役に立ちましたか?

解決

<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").

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top