morten 01/10/10 04:00:39
Modified: java/src/org/apache/xalan/xsltc/compiler Step.java
Log:
Fix for using compound predicates testing attribute values in
expressions (not patterns).
PR: n/a
Obtained from: n/a
Submitted by: [EMAIL PROTECTED]
Reviewed by: [EMAIL PROTECTED]
Revision Changes Path
1.24 +13 -2
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.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- Step.java 2001/10/10 09:20:15 1.23
+++ Step.java 2001/10/10 11:00:39 1.24
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: Step.java,v 1.23 2001/10/10 09:20:15 morten Exp $
+ * @(#)$Id: Step.java,v 1.24 2001/10/10 11:00:39 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -164,6 +164,17 @@
return _predicates != null && _predicates.size() > 0;
}
+ /**
+ * Returns 'true' if this step is used within a predicate
+ */
+ private boolean isPredicate() {
+ SyntaxTreeNode parent = this;
+ while (parent != null) {
+ parent = parent.getParent();
+ if (parent instanceof Predicate) return true;
+ }
+ return false;
+ }
/**
* True if this step is the abbreviated step '.'
@@ -205,7 +216,7 @@
else {
// Special case for '@attr' with no parent or predicates
if ((_axis == Axis.ATTRIBUTE) && (_nodeType!=NodeTest.ATTRIBUTE) &&
- (!hasParentPattern()) && (!_hadPredicates)) {
+ (!hasParentPattern()) && (!_hadPredicates) && (!isPredicate()))
{
_type = Type.Node;
}
else {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]