Bug #4829
closedStatic variable initialised to node values cause run-time failure
0%
Description
When compiling with the XJ compiler a static variable initialised to a node such as:
<xsl:variable name="t" static="yes" select="doc('testStatic.xml')"/>
where testStatic.xml
is:
<foo a="1" xmlns:b="BBB" b:attribute="" xmlns="Flibbertygibbet">
<bar/>
</foo>
the generated package contains a component definition:
<co id='0' binds=''>
<globalVariable name='Q{}t' as='1ND' line='7' .... visibility='PRIVATE' flags='s'>
<node kind='9' content='<foo xmlns="Flibbertygibbet" xmlns:b="BBB" a="1" b:attribute="">
 <bar/>
</foo>' baseUri='....testStatic.xml'/>
</globalVariable>
</co>
that is the serialization of the document is held as the content
property of a node
instruction, with the kind
of the node indicated.
If the selection is doc('testStatic.xml')/(*,*/@*)
the compilation becomes:
<globalVariable name='Q{}t' as='*N' line='7' ....visibility='PRIVATE' flags='s'>
<literal count='3'>
<node kind='1' content='<foo xmlns="Flibbertygibbet" xmlns:b="BBB" a="1" b:attribute="">
 <bar/>
</foo>' baseUri='..../testStatic.xml'/>
<node kind='2' localName='a' content='1'/>
<node kind='2' localName='attribute' prefix='b' ns='BBB' content=''/>
</literal>
</globalVariable>
Execution of a reference to this variable in SaxonJS2
throws an error as there is currently no support for a node
instruction.
There appear to be two routes to solution:
- Converting the export to a nested set of aleady supported node construction instructions
elem
,att
,text
etc, which will be very costly and increase the export size considerably. - Add support for a
node
instruction, using the implementation code forparse-xml()
when necessary
The latter seems much more sensible.
Related issues
Please register to edit this issue
Also available in: Atom PDF Tracking page