You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by js...@apache.org on 2002/11/08 19:35:06 UTC
cvs commit: jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/junit suite.jelly
jstrachan 2002/11/08 10:35:06
Modified: jelly/src/test/org/apache/commons/jelly/junit suite.jelly
Log:
enhanced test case to demonstrate that XPath should not find elements in a document with a namespace URI but no prefix - unless the XPath expression has a prefix.
This is a very common XPath gotcha.
Revision Changes Path
1.5 +5 -1 jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/junit/suite.jelly
Index: suite.jelly
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/junit/suite.jelly,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- suite.jelly 8 Nov 2002 18:27:52 -0000 1.4
+++ suite.jelly 8 Nov 2002 18:35:06 -0000 1.5
@@ -54,7 +54,11 @@
<test:assert test="${ex != null}">We should have created an exception</test:assert>
- The exception was: ${ex.message}
+ <j:catch var="ex">
+ <test:assert xpath="$doc/foo/bar">This should always fail, since foo is not in the empty namespace</test:assert>
+ </j:catch>
+
+ <test:assert test="${ex != null}">We should have created an exception</test:assert>
</test:case>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>