XML parsing using SAX in android
I am trying to parse an XML file using HttpConnection but i am not getting the results right. Problem is that there are lot of attributes in xml file. Please tell me how to parse XML file having attribute with SAX.
<person>
<lastname>Idris</lastname>
<information MobileNo="xyz" AccountNo ="1234"Address ="abcdef"PhoneNo="12345"/>
<firstname>Nazmul</firstname>
<company>The Bean Factory, LLC.</company>
<email>xml@beanfactory.com</email>
</person>
<lastname>Idris</lastname>
<information MobileNo="xyz" AccountNo开发者_高级运维 ="1234"Address ="abcdef"PhoneNo="12345"/>
<firstname>Nazmul</firstname>
<company>The Bean Factory, LLC.</company>
<email>xml@beanfactory.com</email>
</person>
In your Handler-class, you have the 'startElement()'-method, which has a 'Attributes'-parameter. You can read the attributes values from it using the 'getValue()'-methods.
精彩评论