I’m using Saxon-EE 9.3.0.4 for xsl transformations and found that when <xsl:result-document> is used inside <xsl:attribute> (as well as <xsl:namespace>, <xsl:processing-instruction>) instruction, processor
raises XTDE1480 error – Cannot switch to a final result destination while writing a temporary tree
<xsl:attribute name="a">
<xsl:result-document href="result.xml" > - error here
test
</xsl:result-document>
</xsl:attribute>
According to specification (Appendix D) permitted parents for <xsl:result-document> are:
- any XSLT element whose content model is sequence constructor
- any literal result element
Is this is bug in Saxon or limitations for <xsl:result-document> usage, which are not defined in specification?
Update:
I believe that this is not a good idea to use <xsl:result-document> inside <xsl:attribute>, but why error happens?
Thanks
In the spec, you can read :
The xsl:result-document write in a final tree result, and given the rule above, I understand that it is an error to try writting in a final tree result when inside the following elements