On 4/9/2010 2:18 PM, Ramon F. Herrera wrote:
Can I use Xerces-C to perform XPath searches on an XML file by itself?
I don't have a corresponding schema, don't know how to make one and my
XML files are rather large and somewhat complex.
TIA,
-Ramon
This is my code:
DOMDocument* doc = parser->parseURI(xmlFile);
DOMElement* elem = doc->getDocumentElement();
XMLCh* xpathStr = (XMLCh*) "//root/table/size";
DOMNode* node = (DOMNode*) elem;
DOMXPathResult* result = doc->evaluate(xpathStr, node, NULL,
DOMXPathResult::ANY_TYPE, NULL);
cout << "result: " << result << endl;
...and this is the error message I am getting:
Exception message is:
expression has incorrect syntax or contains XPath features not
supported by the XML Schema XPath subset
-Ramon