- From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
- Date: Mon, 19 Oct 2009 10:09:06 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/tasklisttree
In directory hutz:/tmp/cvs-serv29765/src/org/w3c/unicorn/tasklisttree
Modified Files:
XPathCond.java
Log Message:
new response parsing process
+ implementations for the new observer schema
Index: XPathCond.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/tasklisttree/XPathCond.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- XPathCond.java 21 Sep 2009 13:14:29 -0000 1.2
+++ XPathCond.java 19 Oct 2009 10:09:04 -0000 1.3
@@ -1,36 +1,22 @@
package org.w3c.unicorn.tasklisttree;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpression;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.w3c.dom.Document;
+//import org.apache.commons.logging.Log;
+//import org.apache.commons.logging.LogFactory;
import org.w3c.unicorn.UnicornCall;
import org.w3c.unicorn.response.Response;
-import org.xml.sax.SAXException;
-
-import com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl;
public class XPathCond extends TLTCond {
- private static final Log logger = LogFactory.getLog(XPathCond.class);
+ //private static final Log logger = LogFactory.getLog(XPathCond.class);
@Override
public boolean check(UnicornCall unicornCall) {
Response res = unicornCall.getResponses().get(observer.getID());
// Testing if there is a matching response in the map and if it is passed
if (res != null) {
- String xmlStr = res.getXml().toString();
+ return res.evaluateXPath(value);
+
+ /*String xmlStr = res.getXml().toString();
DocumentBuilderFactory xmlFact = DocumentBuilderFactory.newInstance();
xmlFact.setNamespaceAware(false);
try {
@@ -51,7 +37,7 @@
logger.error(e.getMessage(), e);
} catch (XPathExpressionException e) {
logger.error(e.getMessage(), e);
- }
+ }*/
}
return false;
Received on Monday, 19 October 2009 10:09:08 UTC