# Package com.google.api.client.xml (2.1.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.1.0 (latest)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.xml)
- [2.0.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/2.0.3/com.google.api.client.xml)
- [1.47.1](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.47.1/com.google.api.client.xml)
- [1.46.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.46.3/com.google.api.client.xml)
- [1.45.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.45.3/com.google.api.client.xml)
- [1.44.2](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.44.2/com.google.api.client.xml)
- [1.43.2](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.43.2/com.google.api.client.xml)
- [1.42.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.42.3/com.google.api.client.xml)
- [1.41.8](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.41.8/com.google.api.client.xml)
[com.google.api.client.util.Beta](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.Beta)   

Utilities for XML.

## Classes

### [GenericXml](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.xml.GenericXml)

[Beta](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.Beta)   

Generic XML data that stores all unknown key name/value pairs.

Each data key name maps into the name of the XPath expression value for the XML element,
attribute, or text content (using `"text()"`). Subclasses can declare fields for known XML
content using the [Key](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.Key) annotation. Each field can be of any visibility (private, package
private, protected, or public) and must not be static. `null` unknown data key names are
not allowed, but `null` data values are allowed.

Implementation is not thread-safe. For a thread-safe choice instead use an implementation of
ConcurrentMap.

### [Xml](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.xml.Xml)

[Beta](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.Beta)   

XML utilities.

### [Xml.CustomizeParser](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.xml.Xml.CustomizeParser)

Customizes the behavior of XML parsing. Subclasses may override any methods they need to
customize behavior.

Implementation has no fields and therefore thread-safe, but sub-classes are not necessarily
thread-safe.

### [XmlNamespaceDictionary](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.xml.XmlNamespaceDictionary)

[Beta](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.Beta)   

Thread-safe XML namespace dictionary that provides a one-to-one map of namespace alias to URI.

Implementation is thread-safe. For maximum efficiency, applications should use a single
globally-shared instance of the XML namespace dictionary.

A namespace alias is uniquely mapped to a single namespace URI, and a namespace URI is
uniquely mapped to a single namespace alias. In other words, it is not possible to have
duplicates.

Sample usage:


     static final XmlNamespaceDictionary DICTIONARY = new XmlNamespaceDictionary()
     .set("", "http://www.w3.org/2005/Atom")
     .set("activity", "http://activitystrea.ms/spec/1.0/")
     .set("georss", "http://www.georss.org/georss")
     .set("media", "http://search.yahoo.com/mrss/")
     .set("thr", "http://purl.org/syndication/thread/1.0");
     
### [XmlObjectParser](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.xml.XmlObjectParser)

[Beta](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.Beta)   

XML HTTP parser into an data class of key/value pairs.

Implementation is thread-safe.

Sample usage:

static void setParser(HttpRequest request, XmlNamespaceDictionary namespaceDictionary) {
request.setParser(new XmlObjectParser(namespaceDictionary));
}