<taxmann>
<docdetails>
<info id="104010000000007617" date="19780225">
<physicalpath>\\192.168.1.102\CMS\DATA</physicalpath>
<filepath isxml="N">
\NOTIFICATIONS\DIRECTTAXLAWS\HTMLFILES\150025021978.htm
</filepath>
<summary></summary>
<description></description>
<heading>
2187 [S.O.1500] | Section 35(1)(ii) of the Income-tax Act, 1961 - Scientific research expenditure - Approved scientific research associations/institutions
</heading>
<correspondingcitation/>
<hasfile>YES</hasfile>
<sortby>20120328160152743</sortby>
<parentid></parentid>
<parentchapterid></parentchapterid>
</info>
</docdetails>
</taxmann>
ArrayList<HashMap<String, String>> menuItems = new ArrayList<HashMap<String, String>>();
XMLParser parser = new XMLParser();
String xml = parser.getXmlFromUrl(URL); // getting XML
Document doc = parser.getDomElement(xml); // getting DOM element
NodeList nl = doc.getElementsByTagName(KEY_DOCDETAILS);
// looping through all item nodes <item>
for (int i = 0; i < nl.getLength(); i++) {
// creating new HashMap
HashMap<String, String> map = new HashMap<String, String>();
Element e = (Element) nl.item(i);
map.put(KEY_HEADING, parser.getValue(e, KEY_HEADING));
// adding HashList to ArrayList
menuItems.add(map);
}
这是我的XML格式,我想XMLPARSE并希望dsiaply编号,日期,标题IM能够显示标题,但我不打印日期和身份证可以请你告诉我我将如何实施它。这是我的代码打印标题请修改我的代码和打印标题,ID,日期..
请看到这一点: http://xstream.codehaus.org/tutorial.html – Shrikant
可以添加我的代码逻辑请coz我试图做很多不能做到这一点,我已经做了这个例子,但无法理解 – user1693501
你可以粘贴XML的URL? – mukesh