A
anupamjain
Tired, Exhausted, searched the web, usenets,forums thorughly but still
clueless. I guess it's time to post on the group :
This is the issue I have been trying to resolve since today morning :
I have an XHTML document in string form which I parse using Xerces
DOMParser (using an InputSource to read it).
Now I am trying to get to a node for which I have the Xpath, using the
XPathAPI.
So something like this :
Document doc = parser.getDocument(); // where parser is an instance
of DOMParser
Node onenode =
XPathAPI.selectSingleNode(doc,"html/body",doc.getDocumentElement());
I am using doc.getDocumentElement() as the namespace node because the
namespace is declared there - <html
xmlns="http://ww.w3.org/1999/xhtml">
The problem : selectSingleNode is always returning NULL.
I have tried almost everything. I saw somewhere on the groups that
somebody had set the Namespaceaware(boolean) to true for DomFactory but
I am not using DOMFactory. I am using DOMParser and I tried
setNamespaces(boolean) but it cannot find the method (I wonder why -
when it's a derived class from XMLParser).
Anyways, thats the problem I have been dealing with since today morning
(read as 8 hours).
If you have a solution, please help !
Thanks,
Anupam
clueless. I guess it's time to post on the group :
This is the issue I have been trying to resolve since today morning :
I have an XHTML document in string form which I parse using Xerces
DOMParser (using an InputSource to read it).
Now I am trying to get to a node for which I have the Xpath, using the
XPathAPI.
So something like this :
Document doc = parser.getDocument(); // where parser is an instance
of DOMParser
Node onenode =
XPathAPI.selectSingleNode(doc,"html/body",doc.getDocumentElement());
I am using doc.getDocumentElement() as the namespace node because the
namespace is declared there - <html
xmlns="http://ww.w3.org/1999/xhtml">
The problem : selectSingleNode is always returning NULL.
I have tried almost everything. I saw somewhere on the groups that
somebody had set the Namespaceaware(boolean) to true for DomFactory but
I am not using DOMFactory. I am using DOMParser and I tried
setNamespaces(boolean) but it cannot find the method (I wonder why -
when it's a derived class from XMLParser).
Anyways, thats the problem I have been dealing with since today morning
(read as 8 hours).
If you have a solution, please help !
Thanks,
Anupam