summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5d8a2d1)
raw | patch | inline | side by side (parent: 5d8a2d1)
author | ishmal <ishmal@users.sourceforge.net> | |
Mon, 22 May 2006 01:13:09 +0000 (01:13 +0000) | ||
committer | ishmal <ishmal@users.sourceforge.net> | |
Mon, 22 May 2006 01:13:09 +0000 (01:13 +0000) |
src/dom/work/testxpath.cpp | patch | blob | history |
index b8551f2de389df28bdf358532258489be27af5f9..380dc77e1f08627527a8f419afacb121d9a83932 100644 (file)
* Authors:
* Bob Jamison
*
- * Copyright (C) 2005 Bob Jamison
+ * Copyright (C) 2006 Bob Jamison
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#include <stdio.h>
-using namespace org::w3c::dom;
-using namespace org::w3c::dom::xpath;
+
+typedef org::w3c::dom::Node Node;
+typedef org::w3c::dom::NodeList NodeList;
+typedef org::w3c::dom::DOMString DOMString;
+typedef org::w3c::dom::Document Document;
+typedef org::w3c::dom::io::StdWriter StdWriter;
+typedef org::w3c::dom::ls::DOMImplementationLSImpl DOMImplementationLSImpl;
+typedef org::w3c::dom::ls::LSSerializer LSSerializer;
+typedef org::w3c::dom::ls::LSOutput LSOutput;
+typedef org::w3c::dom::ls::LSInput LSInput;
+typedef org::w3c::dom::ls::LSParser LSParser;
+typedef org::w3c::dom::xpath::XPathParser XPathParser;
+
typedef struct
void dumpDoc(Document *doc)
{
- ls::DOMImplementationLSImpl domImpl;
- ls::LSSerializer &serializer = domImpl.createLSSerializer();
- ls::LSOutput output = domImpl.createLSOutput();
- io::StdWriter writer;
+ DOMImplementationLSImpl domImpl;
+ LSSerializer &serializer = domImpl.createLSSerializer();
+ LSOutput output = domImpl.createLSOutput();
+ StdWriter writer;
output.setCharacterStream(&writer);
serializer.write(doc, output);
}
bool doXmlTest(XpathTest *xpt)
{
+ printf("################################################################\n");
+
//### READ
- ls::DOMImplementationLSImpl domImpl;
- ls::LSInput input = domImpl.createLSInput();
- ls::LSParser &parser = domImpl.createLSParser(0, "");
+ DOMImplementationLSImpl domImpl;
+ LSInput input = domImpl.createLSInput();
+ LSParser &parser = domImpl.createLSParser(0, "");
input.setStringData(xpt->xml);
Document *doc = parser.parse(input);
XPathParser xp;
xp.setDebug(true);
- org::w3c::dom::NodeList list = xp.evaluate(doc, xpt->xpathStr);
+ DOMString xpathStr = xpt->xpathStr;
+ NodeList list = xp.evaluate(doc, xpathStr);
for (unsigned int i=0 ; i<list.getLength() ; i++)
{
- org::w3c::dom::Node *n = list.item(i);
+ Node *n = list.item(i);
+ printf("@@ node: %s\n", n->getNodeName().c_str());
}
//dumpDoc(doc);