Thanks for your post, but i finally found out what was wrong.
rdf is the first node it's like = document.getElementsByTagName("rdf:RDF").item(0);
(this isn't the actual code, because i check for erros and all, but it's the simplified version)
The uri mappings are given in the TestNameSpace, the construct read the xmlns attributes from the rdf node (explained above) and stores 3 variables, then when i need a prefix it does this
if(prefix.compareToIgnoreCase("rdf") == 0)
return rdf;
else if(prefix.compareToIgnoreCase("prf") == 0)
return prf;
else if(prefix.compareToIgnoreCase("mms") == 0)
return mms;
return null;
Now for the resolution, actually it was quite simple, but i still don't quite understand the reason.
The problem was with the expression, in my code i had several expressions, for example
String expr = "rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:Vendor/text()";
this worked fine with the InputSource, but with a document, i had to take out the prefixes, so i had to evaluate
String expr = "RDF/Description/component/Description/Vendor/text()";
And this worked
|