Hi,
I am trying to get the list of elements using xpath. The below code is
returning 0
DOMParser parser = new DOMParser();
Document doc = parser.parse("D:/util/compare/util.xml");
NodeList gvNodeList = XPathAPI.selectNodeList(doc, "//address/name");
System.out.println("------lenth-------->"+gvNodeList.getLength());
But the below code works fine, returning 3
javax.xml.parsers.DocumentBuilderFactory df =
javax.xml.parsers.DocumentBuilderFactory.newInstance();
df.setValidating(false);
Document xml_schema =
df.newDocumentBuilder().parse("D:/util/compare/util..xml");
NodeList xml_tables = XPathAPI.selectNodeList(xml_schema,"//application");
System.out.println("------lenth-------->"+xml_tables.getLength());
The only difference is I am parsing the xml using DocumentBuilderFactory
Can anyonetell me whats wrong with my previous code
Thanks in advance,
bce
Get your preferred Email name!
Now you can @ymail.com and @rocketmail.com
http://mail.promotions.yahoo.com/newdomains/sg/