Top Description Constructors Methods
org.apache.pdfbox.util

public final Class XMLUtil

extends Object
Class Inheritance
Imports
java.io.InputStream, .IOException, javax.xml.parsers.DocumentBuilder, .DocumentBuilderFactory, .FactoryConfigurationError, .ParserConfigurationException, org.w3c.dom.Document, .Element, .Node, .NodeList, .Text, org.xml.sax.SAXException

This class with handle some simple XML operations.
Author
Ben Litchfield

Constructor Summary

AccessConstructor and Description
private
XMLUtil()

Utility class, should not be instantiated.

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

The text of the node.
getNodeValue
(Element
The node to get the text value for.
node
)

This will get the text value of an element.

public static Document

Returns:

The DOM document.
parse
(InputStream
The stream to get the XML from.
is
)

This will parse an XML stream and create a DOM document.

public static Document

Returns:

The DOM document.
parse
(InputStream
The stream to get the XML from.
is
,
boolean
activates namespace awareness of the parser
nsAware
)

This will parse an XML stream and create a DOM document.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

XMLUtilback to summary
private XMLUtil()

Utility class, should not be instantiated.

Method Detail

getNodeValueback to summary
public static String getNodeValue(Element node)

This will get the text value of an element.

Parameters
node:Element

The node to get the text value for.

Returns:String

The text of the node.

parseback to summary
public static Document parse(InputStream is) throws IOException

This will parse an XML stream and create a DOM document.

Parameters
is:InputStream

The stream to get the XML from.

Returns:Document

The DOM document.

Exceptions
IOException:
It there is an error creating the dom.
parseback to summary
public static Document parse(InputStream is, boolean nsAware) throws IOException

This will parse an XML stream and create a DOM document.

Parameters
is:InputStream

The stream to get the XML from.

nsAware:boolean

activates namespace awareness of the parser

Returns:Document

The DOM document.

Exceptions
IOException:
It there is an error creating the dom.