Summary: Fields | Methods | Inherited Methods
public
class
Xml
extends Object
XML utility methods.
Summary
Fields | |
|---|---|
public
static
String |
FEATURE_RELAXED
|
Public methods | |
|---|---|
static
AttributeSet
|
asAttributeSet(XmlPullParser parser)
Return an AttributeSet interface for use with the given XmlPullParser. |
static
Xml.Encoding
|
findEncodingByName(String encodingName)
Finds an encoding by name. |
static
XmlPullParser
|
newPullParser()
Returns a new pull parser with namespace support. |
static
XmlSerializer
|
newSerializer()
Creates a new xml serializer. |
static
void
|
parse(String xml, ContentHandler contentHandler)
Parses the given xml string and fires events on the given SAX handler. |
static
void
|
parse(InputStream in, Xml.Encoding encoding, ContentHandler contentHandler)
Parses xml from the given input stream and fires events on the given SAX handler. |
static
void
|
parse(Reader in, ContentHandler contentHandler)
Parses xml from the given reader and fires events on the given SAX handler. |
Inherited methods | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
From class
| |||||||||||||||||||||||
Fields
Public methods
asAttributeSet
public static AttributeSet asAttributeSet (XmlPullParser parser)
Return an AttributeSet interface for use with the given XmlPullParser. If the given parser itself implements AttributeSet, that implementation is simply returned. Otherwise a wrapper class is instantiated on top of the XmlPullParser, as a proxy for retrieving its attributes, and returned to you.
| Parameters | |
|---|---|
parser |
XmlPullParser: The existing parser for which you would like an
AttributeSet. |
| Returns | |
|---|---|
AttributeSet |
An AttributeSet you can use to retrieve the attribute values at each of the tags as the parser moves through its XML document. |
newPullParser
public static XmlPullParser newPullParser ()
Returns a new pull parser with namespace support.
| Returns | |
|---|---|
XmlPullParser |
|
parse
public static void parse (String xml, ContentHandler contentHandler)
Parses the given xml string and fires events on the given SAX handler.
| Parameters | |
|---|---|
xml |
String |
contentHandler |
ContentHandler |
| Throws | |
|---|---|
SAXException |
|
parse
public static void parse (Reader in, ContentHandler contentHandler)
Parses xml from the given reader and fires events on the given SAX handler.
| Parameters | |
|---|---|
in |
Reader |
contentHandler |
ContentHandler |
| Throws | |
|---|---|
IOException |
|
SAXException |
|