java.lang.Object | ||
↳ | android.sax.Element | |
↳ | android.sax.RootElement |
The root XML element. The entry point for this API. Not safe for concurrent use.
For example, passing this XML:
<feed xmlns='http://www.w3.org/2005/Atom'>to this code:
<entry>
<id>bob</id>
</entry>
</feed>
static final String ATOM_NAMESPACE = "http://www.w3.org/2005/Atom";would output:
...
RootElement root = new RootElement(ATOM_NAMESPACE, "feed");
Element entry = root.getChild(ATOM_NAMESPACE, "entry");
entry.getChild(ATOM_NAMESPACE, "id").setEndTextElementListener(
new EndTextElementListener() {
public void end(String body) {
System.out.println("Entry ID: " + body);
}
});
XMLReader reader = ...;
reader.setContentHandler(root.getContentHandler());
reader.parse(...);
Entry ID: bob
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new root element with the given name.
| |||||||||||
Constructs a new root element with the given name.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets the SAX
ContentHandler . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Constructs a new root element with the given name.
uri | the namespace |
---|---|
localName | the local name |
Constructs a new root element with the given name. Uses an empty string as the namespace.
localName | the local name |
---|
Gets the SAX ContentHandler
. Pass this to your SAX parser.