You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by zo...@apache.org on 2004/02/24 05:21:22 UTC
cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/compiler Step.java
zongaro 2004/02/23 20:21:22
Modified: java/src/org/apache/xalan/xsltc/compiler Step.java
Log:
Part of fix for bug report 24985. The code that resulted for a NodeTest of
the form "@p:*" or "attribute::p:*" was identical to that for "@*" - in other
words, the prefix was not being tested. Fixed this so that
DOM.getNamespaceAxisIterator is used to create the right kind of iterator.
Reviewed by Morris Kwan (mkwan () ca ! ibm ! com).
Revision Changes Path
1.46 +18 -17 xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Step.java
Index: Step.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Step.java,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- Step.java 16 Feb 2004 22:24:29 -0000 1.45
+++ Step.java 24 Feb 2004 04:21:22 -0000 1.46
@@ -222,12 +222,23 @@
if (hasPredicates()) {
translatePredicates(classGen, methodGen);
- }
- else {
- // If it is an attribute but not '@*', '@attr' or '@node()' and
- // has no parent
- if (_axis == Axis.ATTRIBUTE && _nodeType != NodeTest.ATTRIBUTE &&
- _nodeType != NodeTest.ANODE && !hasParentPattern())
+ } else {
+ int star = 0;
+ String name = null;
+ final XSLTC xsltc = getParser().getXSLTC();
+
+ if (_nodeType >= DTM.NTYPES) {
+ final Vector ni = xsltc.getNamesIndex();
+
+ name = (String)ni.elementAt(_nodeType-DTM.NTYPES);
+ star = name.lastIndexOf('*');
+ }
+
+ // If it is an attribute, but not '@*', '@pre:*' or '@node()',
+ // and has no parent
+ if (_axis == Axis.ATTRIBUTE && _nodeType != NodeTest.ATTRIBUTE
+ && _nodeType != NodeTest.ANODE && !hasParentPattern()
+ && star == 0)
{
int iter = cpg.addInterfaceMethodref(DOM_INTF,
"getTypedAxisIterator",
@@ -280,16 +291,6 @@
il.append(new INVOKEINTERFACE(git, 2));
break;
default:
- final XSLTC xsltc = getParser().getXSLTC();
- final Vector ni = xsltc.getNamesIndex();
- String name = null;
- int star = 0;
-
- if (_nodeType >= DTM.NTYPES) {
- name = (String)ni.elementAt(_nodeType-DTM.NTYPES);
- star = name.lastIndexOf('*');
- }
-
if (star > 1) {
final String namespace;
if (_axis == Axis.ATTRIBUTE)
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org