When i declare a default namespace for my xml document, my XPath expressions
no longer work. For the following xml document, which i cut off for the sake
of brevity, the expression "/invoice/header/dealer/LocationCode/text()"
worked fine. But as soon as i declared the default namespace, as seen below,
it no longer returns any nodes. I'm using the code:
Node blah =
XPathAPI.selectSingleNode(e,"/invoice/header/dealer/LocationCode/text()");
System.out.println(blah.getNodeValue());
Any suggestions/solutions would be appreciated,
Mark
<?xml version="1.0" encoding="UTF-8"?>
<invoice xmlns="http://localhost/namespaces/FleetCharge"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://localhost/namespaces/FleetCharge
http://localhost/dcninf/xmlschemas/test/newschema.xsd"
XMLDocumentCreateTimestamp="2001-12-17T09:30:47-05:00"
SchemaVersion="3.1415926535897932384626433832795">
<header>
<dealer>
<LocationCode>000</LocationCode>