org.fourthline.cling.model

## Class XMLUtil

- java.lang.Object
- - org.fourthline.cling.model.XMLUtil

-     public class XMLUtil
      extends Object

  XML handling and printing shortcuts.

  This class exists because Android 2.1 does not offer any way to print an `org.w3c.dom.Document`, and it also doesn't implement the most trivial methods to build a DOM (although the API is provided, they fail at runtime). We might be able to remove this class once compatibility for Android 2.1 can be dropped.

  Author:
    Christian Bauer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XMLUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Element` | `appendNewElement(Document document, Element parent, Enum el)`
    `static Element` | `appendNewElement(Document document, Element parent, String element)`
    `static Element` | `appendNewElement(Document document, Element parent, String element, Object content)`
    `static Element` | `appendNewElement(Document document, Element parent, String element, Object content, String namespace)`
    `static Element` | `appendNewElementIfNotNull(Document document, Element parent, Enum el, Object content)`
    `static Element` | `appendNewElementIfNotNull(Document document, Element parent, Enum el, Object content, String namespace)`
    `static Element` | `appendNewElementIfNotNull(Document document, Element parent, String element, Object content)`
    `static Element` | `appendNewElementIfNotNull(Document document, Element parent, String element, Object content, String namespace)`
    `static String` | `documentToFragmentString(Document document)`
    `static String` | `documentToString(Document document)`
    `static String` | `documentToString(Document document, boolean standalone)`
    `static String` | `encodeText(String s)`
    `static String` | `encodeText(String s, boolean encodeQuotes)`
    `static String` | `getTextContent(Node node)`
    `protected static String` | `nodeToString(Node node, Set<String> parentPrefixes, String namespaceURI)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### XMLUtil

          public XMLUtil()

  - ### Method Detail

    - #### documentToString

          public static String documentToString(Document document)
                                         throws Exception

      Throws:
        `Exception`

    - #### documentToString

          public static String documentToString(Document document,
                                                boolean standalone)
                                         throws Exception

      Throws:
        `Exception`

    - #### documentToFragmentString

          public static String documentToFragmentString(Document document)
                                                 throws Exception

      Throws:
        `Exception`

    - #### nodeToString

          protected static String nodeToString(Node node,
                                               Set<String> parentPrefixes,
                                               String namespaceURI)
                                        throws Exception

      Throws:
        `Exception`

    - #### encodeText

          public static String encodeText(String s)

    - #### encodeText

          public static String encodeText(String s,
                                          boolean encodeQuotes)

    - #### appendNewElement

          public static Element appendNewElement(Document document,
                                                 Element parent,
                                                 Enum el)

    - #### appendNewElement

          public static Element appendNewElement(Document document,
                                                 Element parent,
                                                 String element)

    - #### appendNewElementIfNotNull

          public static Element appendNewElementIfNotNull(Document document,
                                                          Element parent,
                                                          Enum el,
                                                          Object content)

    - #### appendNewElementIfNotNull

          public static Element appendNewElementIfNotNull(Document document,
                                                          Element parent,
                                                          Enum el,
                                                          Object content,
                                                          String namespace)

    - #### appendNewElementIfNotNull

          public static Element appendNewElementIfNotNull(Document document,
                                                          Element parent,
                                                          String element,
                                                          Object content)

    - #### appendNewElementIfNotNull

          public static Element appendNewElementIfNotNull(Document document,
                                                          Element parent,
                                                          String element,
                                                          Object content,
                                                          String namespace)

    - #### appendNewElement

          public static Element appendNewElement(Document document,
                                                 Element parent,
                                                 String element,
                                                 Object content)

    - #### appendNewElement

          public static Element appendNewElement(Document document,
                                                 Element parent,
                                                 String element,
                                                 Object content,
                                                 String namespace)

    - #### getTextContent

          public static String getTextContent(Node node)

Copyright © 2015 4th Line GmbH, Switzerland. All rights reserved.