Added in API level 1

Xml


open class Xml
kotlin.Any
   ↳ android.util.Xml

XML utility methods.

Summary

Nested classes

Supported character encodings.

Public methods
open static AttributeSet!

Return an AttributeSet interface for use with the given XmlPullParser.

open static Xml.Encoding!
findEncodingByName(encodingName: String!)

Finds an encoding by name.

open static XmlPullParser!

Returns a new pull parser with namespace support.

open static XmlSerializer!

Creates a new xml serializer.

open static Unit
parse(xml: String!, contentHandler: ContentHandler!)

Parses the given xml string and fires events on the given SAX handler.

open static Unit
parse(in: Reader!, contentHandler: ContentHandler!)

Parses xml from the given reader and fires events on the given SAX handler.

open static Unit
parse(in: InputStream!, encoding: Xml.Encoding!, contentHandler: ContentHandler!)

Parses xml from the given input stream and fires events on the given SAX handler.

Properties
static String!

org.xmlpull.v1.XmlPullParser "relaxed" feature name.

Public methods

asAttributeSet

Added in API level 1
open static fun asAttributeSet(parser: XmlPullParser!): AttributeSet!

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.
Return
AttributeSet! An AttributeSet you can use to retrieve the attribute values at each of the tags as the parser moves through its XML document.

findEncodingByName

Added in API level 1
open static fun findEncodingByName(encodingName: String!): Xml.Encoding!

Finds an encoding by name. Returns UTF-8 if you pass null.

newPullParser

Added in API level 1
open static fun newPullParser(): XmlPullParser!

Returns a new pull parser with namespace support.

newSerializer

Added in API level 1
open static fun newSerializer(): XmlSerializer!

Creates a new xml serializer.

parse

Added in API level 1
open static fun parse(
    xml: String!,
    contentHandler: ContentHandler!
): Unit

Parses the given xml string and fires events on the given SAX handler.

parse

Added in API level 1
open static fun parse(
    in: Reader!,
    contentHandler: ContentHandler!
): Unit

Parses xml from the given reader and fires events on the given SAX handler.

parse

Added in API level 1
open static fun parse(
    in: InputStream!,
    encoding: Xml.Encoding!,
    contentHandler: ContentHandler!
): Unit

Parses xml from the given input stream and fires events on the given SAX handler.

Properties

FEATURE_RELAXED

Added in API level 1
static var FEATURE_RELAXED: String!

org.xmlpull.v1.XmlPullParser "relaxed" feature name.

See Also