commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Venkatesh Prasad Ranganath <vrangan...@cox.net>
Subject JXPath: XMl traversal
Date Wed, 26 Mar 2003 13:04:18 GMT
Hi,

The following snippet of code never dives into loop body for the subsequent document.  Can
somebody tell me what might I be 
doing wrong?

<doc is a Document object obtained from jaxp parser>
Element root = doc.getDocumentElement();
JXPathContext ctxt = JXPathContext.newContext(root);
for(Iterator i = ctxt.iterate("CONFIGURATION/PROCESSOR"); i.hasNext();) {
	System.out.println("1");
	processProcessor((Element) i.next());
}


<?xml version="1.0" encoding="UTF-8"?>
<!-- DOCTYPE CONFIGURATION SYSTEM "MC__1_1BasicSP.dtd"-->
<!DOCTYPE CONFIGURATION SYSTEM "OEP_Configuration_2_2.dtd">
<CONFIGURATION>
     <PROCESSOR>
         <NAME> PROCESSOR1 </NAME>
     </PROCESSOR>
</CONFIGURATION>

waiting for reply,
-- 

Venkatesh Prasad Ranganath,
Dept. Computing and Information Science,
Kansas State University, US.
web: http://www.cis.ksu.edu/~rvprasad


Mime
View raw message