Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 8
Registered: ‎05-05-2009
My Device: Not Specified

How to read attributes when parsing XML file.

Who knows how to read attributes when parsing XML file.

Thanks.

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: How to read attributes when parsing XML file.

[ Edited ]

You subclass DefaultHandler and override startElement. Your handler class is passed to the SAX parser. startElement is called at the start of each element, and passes an Attributes object to your code.

 

See the API docs, as well as the XML demo code that ships with the JDE.

 

SaxParser

SaxParserfactory

Attribute

DefaultHandler

 

 

 

Message Edited by RexDoug on 05-12-2009 05:04 PM