Details
-
Bug
-
Status: Resolved
-
Resolution: Won't Fix
-
1.3.x
-
None
-
None
-
Operating System: Other
Platform: Other
-
7918
Description
The parent of namespace-nodes in Xalan-C 1.3 is the node, that defines the
namespace.
XPath-Rec says:
5.4 Namespace Nodes
Elements never share namespace nodes: if one element node is not the same node
as another element node, then none of the namespace nodes of the one element
node will be the same node as the namespace nodes of another element node.
If the namespace-nodes in Xalan-C have the same parent, they are shared?
Sample-XML:
<?xml version="1.0" encoding="iso-8859-1" ?>
<test xmlns:ab="http://www.hendrik/test1">
<testh xmlns:ab="http://www.hendrik/test1">
<node1>Text1</node1>
<node2 attrib="attribtext2">Text2</node2>
</testh>
</test>
Sample-XSL:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="*">
<xsl:variable name="name" select="name()"/>
Element:<xsl:value-of select="name()"/>
<xsl:for-each select="namespace::*">
namespace-prefix: <xsl:value-of select="name()"/>
namespace-uri : <xsl:value-of select="."/>
parent : <xsl:for-each select="parent::node()"><xsl:value-of
select="name()"/></xsl:for-each></xsl:for-each>
<xsl:apply-templates />
</xsl:template>
</xsl:stylesheet>
Output:
...
Element:node1
namespace-prefix: ab
namespace-uri : http://www.hendrik/test1
parent : testh
...