You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2001/10/15 00:13:26 UTC
DO NOT REPLY [Bug 4158] New: -
current node not same as context node in certain templates
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4158>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4158
current node not same as context node in certain templates
Summary: current node not same as context node in certain
templates
Product: XalanJ2
Version: CurrentCVS
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: Minor
Priority: Other
Component: Xalan
AssignedTo: xalan-dev@xml.apache.org
ReportedBy: mratliff@unival.com
Context node is not same as content node executing template invoked by for-each.
XML FILE:
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<test type="current/context">
<outer_element>
<inner_element>foo</inner_element>
</outer_element>
</test>
XSLT FILE:
<?xml version="1.0" standalone="no"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="outer_element">
<xsl:for-each select="*">
<xsl:apply-templates select="current()" />
</xsl:for-each>
</xsl:template>
<xsl:template match="inner_element">
<xsl:message>current node= <xsl:value-of select="current()" /></xsl:message>
<xsl:message>context node= <xsl:value-of select="." /></xsl:message>
</xsl:template>
</xsl:stylesheet>
RESULT (WRITTEN TO CONSOLE):
current node=
context node= foo
These two values should be identical (they ARE identical if you remove the <for-
each select="*"> from the outer_element template).
This worked in xalan-j_2_2_D6; broken in D11.