zongaro 2004/10/01 15:01:24
Modified: java/src/org/apache/xpath/compiler XPathParser.java
java/src/org/apache/xpath/patterns NodeTest.java
Log:
Patch from Yash Talwar (ytalwar () ca ! ibm ! com) for Jira bug report 1186.
The existing code in the interpretive processor was handling namespace::pre by
resolving the namespace prefix "pre" in the stylesheet, and then looking for
namespace nodes with that same URI in the input document. In fact, it should
look for namespaces nodes in the input document that declare the prefix "pre",
without regard to the associated URI.
The patch was reviewed by myself (zongaro () ca ! ibm ! com).
Revision Changes Path
1.29 +1 -11
xml-xalan/java/src/org/apache/xpath/compiler/XPathParser.java
Index: XPathParser.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/compiler/XPathParser.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- XPathParser.java 17 Feb 2004 04:32:49 -0000 1.28
+++ XPathParser.java 1 Oct 2004 22:01:24 -0000 1.29
@@ -1843,16 +1843,6 @@
}
else
{
- if (OpCodes.FROM_NAMESPACE == axesType)
- {
- String prefix = (String)
this.m_ops.m_tokenQueue.elementAt(m_queueMark - 1);
- String namespace =
- ((PrefixResolver) m_namespaceContext).getNamespaceForPrefix(
- prefix);
-
- this.m_ops.m_tokenQueue.setElementAt(namespace,m_queueMark - 1);
- }
-
m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1);
// Minimalist check for an NCName - just check first character
1.29 +3 -3
xml-xalan/java/src/org/apache/xpath/patterns/NodeTest.java
Index: NodeTest.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/patterns/NodeTest.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- NodeTest.java 17 Aug 2004 19:25:42 -0000 1.28
+++ NodeTest.java 1 Oct 2004 22:01:24 -0000 1.29
@@ -564,7 +564,7 @@
// the prefix expands, regardless of the local part of the name."
case DTMFilter.SHOW_NAMESPACE :
{
- String ns = dtm.getNodeValue(context);
+ String ns = dtm.getLocalName(context);
return (subPartMatch(ns, m_name)) ? m_score : SCORE_NONE;
}
@@ -637,7 +637,7 @@
// the prefix expands, regardless of the local part of the name."
case DTMFilter.SHOW_NAMESPACE :
{
- String ns = dtm.getNodeValue(context);
+ String ns = dtm.getLocalName(context);
return (subPartMatch(ns, m_name)) ? m_score : SCORE_NONE;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]