sboag 01/07/30 10:32:33
Modified: java/src/org/apache/xpath/axes PredicatedNodeTest.java
java/src/org/apache/xpath/compiler OpMap.java
Log:
Bit of a hack to make /descendant-or-self::north with getFirstPredicateOpPos
where getFirstPredicateOpPos was always throwing an error if
there was not a predicate (!! Should have been discovered before
now?!?!). If -2 return -2 (instead of throwing an error), and
handle this case in PredicatedNodeTest#initPredicateInfo.
Revision Changes Path
1.8 +2 -1
xml-xalan/java/src/org/apache/xpath/axes/PredicatedNodeTest.java
Index: PredicatedNodeTest.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/axes/PredicatedNodeTest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- PredicatedNodeTest.java 2001/07/28 00:45:05 1.7
+++ PredicatedNodeTest.java 2001/07/30 17:32:32 1.8
@@ -139,7 +139,8 @@
int pos = compiler.getFirstPredicateOpPos(opPos);
- m_predicates = compiler.getCompiledPredicates(pos);
+ if(pos > 0)
+ m_predicates = compiler.getCompiledPredicates(pos);
}
/**
1.10 +4 -0 xml-xalan/java/src/org/apache/xpath/compiler/OpMap.java
Index: OpMap.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/compiler/OpMap.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- OpMap.java 2001/07/30 17:12:00 1.9
+++ OpMap.java 2001/07/30 17:32:32 1.10
@@ -321,6 +321,10 @@
{
return opPos + m_opMap[opPos + 1];
}
+ else if(-2 == stepType)
+ {
+ return -2;
+ }
else
{
error(org.apache.xpath.res.XPATHErrorResources.ER_UNKNOWN_OPCODE,
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]