The last couple days I tried to parse a XML file but I got no success. Im using SAX parser but the XML is recursive and I don't know you to control de parsing.
The XML is quite extense, but below you can see a sample of how it is.
<root>
<prop1>teste</prop1>
<items>
<item>
<prop1>teste1</prop1>
<items>
<item>开发者_如何学Go;
<prop1>teste1.1</prop1>
<items null />
</item>
</items>
</item>
<item>
<prop1>teste1</prop1>
<items null />
</item>
</items>
</root>
I don't know how to handle the loop inside the startElement and the endElement methods. Any help would be cool... thanks in advance.
Check this out: http://www.javaworld.com/javaworld/jw-08-2000/jw-0804-sax.html?page=1
This article shows how to employ the SAX API to map XML documents to Java objects.
Hope this helps you. Let me know if you have more doubts.
Thanks.
精彩评论