Thanks Edwin for pointing me to the right direction. After searching other
messages (epecially the one from Barbara Warwood), I was able to resolve the
problem.
Here it is:
javax.xml.parsers.DocumentBuilderFactory dbf
= javax.xml.parsers.DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(false);
// Step 2: create a DocumentBuilder
DocumentBuilder db = dbf.newDocumentBuilder();
java.io.ByteArrayInputStream bIS = new
java.io.ByteArrayInputStream(any[i].toString().getBytes());
org.xml.sax.InputSource is = new org.xml.sax.InputSource(bIS);
// Step 3: parse the input file to get a Document object
org.w3c.dom.Document w3cdoc = db.parse(is);
// Pass the w3c document to dom4j so that it will work with
namespaces
Document doc = new DOMReader().read(w3cdoc);
Node nd = doc.selectSingleNode(".//Error");
if (nd != null)
{
System.out.println("SingleNodeFound => " + nd.getText());
}
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user