zongaro 2004/02/24 03:40:02
Modified: java/src/org/apache/xalan/xsltc/compiler Tag:
xslt20-compiled 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
No revision
No revision
1.43.4.1 +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.43
retrieving revision 1.43.4.1
diff -u -r1.43 -r1.43.4.1
--- Step.java 1 Apr 2003 21:09:00 -0000 1.43
+++ Step.java 24 Feb 2004 11:40:02 -0000 1.43.4.1
@@ -262,12 +262,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",
@@ -320,16 +331,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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]