android.util
public
class
android.util.Xml
XML utility methods.
Nested Classes
Summary
Fields
Public Constructors
Public Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Fields
public
static
String
FEATURE_RELAXED
Public Constructors
Public Methods
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
| The existing parser for which you would like an
AttributeSet. |
Returns
- An AttributeSet you can use to retrieve the
attribute values at each of the tags as the parser moves
through its XML document.
public
static
Xml.Encoding
findEncodingByName(String encodingName)
Finds an encoding by name. Returns UTF-8 if you pass
null
.
public
static
XmlPullParser
newPullParser()
Creates a new pull parser with namespace support.
Note: This is actually slower than the SAX parser, and it's not
fully implemented. If you need a fast, mostly implemented pull parser,
use this. If you need a complete implementation, use KXML.
public
static
XmlSerializer
newSerializer()
Creates a new xml serializer.
public
static
void
parse(String xml, ContentHandler contentHandler)
Parses the given xml string and fires events on the given SAX handler.
public
static
void
parse(Reader in, ContentHandler contentHandler)
Parses xml from the given reader and fires events on the given SAX
handler.
Parses xml from the given input stream and fires events on the given SAX
handler.