The restriction means that the following line within test.html
fails:
<script type="application/xslt+xml" language="xslt2.0" src="Ind_Pers_de.xsl" data-source="test.html"></script>
The data-source attribute, test.html
is the same URL as the page containing this script
element. Because the ixsl:page()
function is used to access the host page DOM, you don't need to set test.html
as the data-source also - and there's the potential for confusion/ambiguity if you do - hence the restriction.
When you're not interested in another XML data-source you still need an 'entry-point' for the XSLT processor, the approach here would normally be to set the initial template name instead, like 'main' as shown in the example below:
<script type="application/xslt+xml" language="xslt2.0" src="Ind_Pers_de.xsl" data-initial-template="main"></script>
With this set, all that remains is to change the entry-point template to be named 'main', instead of having a match="/"
attribute - as follows:
<xsl:template name="main">
<xsl:result-document href="#htmlbody" method="ixsl:replace-content">
<xsl:apply-templates select="ixsl:page()/*/*/*[@id='htmlbody']/*" mode="init"/>
</xsl:result-document>
</xsl:template>
Fortunately, your code was already using ixsl:page()
(instead of the context node) to access the document node - so the unaltered select
attribute value in the apply-templates
instruction in your code should have the desired effect.
The bug that causes different behaviours depending on URLs and Saxon/SaxonDebug versions will be fixed for the next maintenance release. I should also mention that if you need to set the Saxon logLevel without using a URL parameter (like this case when the URL affects behaviour) you could use the alternative JavaScript API instead of the xslt2.0 script
element as follows:
<script type="text/javascript" language="javascript">
onSaxonLoad = function() {
proc = Saxon.run( {
stylesheet: 'Ind_Pers_de.xsl',
initialTemplate: 'main',
logLevel: 'FINEST'
} );
}
</script>