hi,
i've some problems using xml with the default namespace. i use Xalan 2.6.0. this is the problem:
i have an xml-file similar to this:
<?xml version="1.0" encoding="UTF-8"?>
<elem xmlns="uni-leipzig.de" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Version="2001-1" xsi:schemaLocation="uni-leipzig.de ANY_URL">
<child name="test"/>
<child name="test2"/>
</elem> now i want to use some xpath expressions like this /elem/child/@name
for this i use an example similar to the ApplyXPathDOM example delievered by xalan.
objEvaluator = new XPathEvaluatorImpl( objMessage );
objResolver = objEvaluator.createNSResolver( objMessage );
objResult = (XPathResult)objEvaluator.evaluate(strXPath, objMessage, objResolver, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
all this works fine for xml files like this:
<?xml version="1.0" encoding="UTF-8"?>
<elem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Version="2001-1" xsi:schemaLocation="uni-leipzig.de ANY_URL">
<child name="test"/>
<child name="test2"/>
</elem>
(files where the default namespace is not set). is this namespace set i get an nullpointer exeception.
does have anyone an idea??
thankz
ciao marco
