Compile the namesArray, urisArray, typesArray, namespaceArray,
namespaceAncestorsArray, prefixURIsIdxArray and prefixURIPairsArray into
the static initializer. They are read-only from the
translet. All translet instances can share a single
copy of this informtion.
The namespaceAncestorsArray
,
prefixURIsIdxArray
and prefixURIPairsArray
contain namespace information accessible from the stylesheet:
namespaceAncestorsArray
Array indexed by integer stylesheet node IDs containing node IDs of
the nearest ancestor node in the stylesheet with namespace
declarations or -1
if there is no such ancestor. There
can be more than one disjoint tree of nodes - one for each stylesheet
module
prefixURIsIdxArray
Array indexed by integer stylesheet node IDs containing the index
into prefixURIPairsArray
of the first namespace prefix
declared for the node. The values are stored in ascending order, so
the next value in this array (if any) can be used to find the last such
prefix-URI pair
prefixURIPairsArray
Array of pairs of namespace prefixes and URIs. A zero-length
string represents the default namespace if it appears as a prefix and
a namespace undeclaration if it appears as a URI.
For this stylesheet
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:for-each select="*" xmlns:foo="foouri">
<xsl:element name="{n}" xmlns:foo="baruri">
</xsl:for-each>
<out xmlns="lumpit"/>
<xsl:element name="{n}" xmlns="foouri"/>
<xsl:element name="{n}" namespace="{ns}" xmlns="limpit"/gt;
</xsl:template>
</xsl:stylesheet>
there will be four stylesheet nodes whose namespace information is
needed, and
namespaceAncestorsArray
will have the value
[-1,0,1,0]
;
prefixURIsIdxArray
will have the value
[0,4,6,8]
; and
prefixURIPairsArray
will have the value
["xml","http://www.w3.org/XML/1998/namespace",
"xsl","http://www.w3.org/1999/XSL/Transform"
"foo","foouri","foo","baruri","","foouri"].