XmlUtil (Apache OpenNLP Tools 1.9.5 API)
Date: 2026-06-18

opennlp.tools.util

## Class XmlUtil

- java.lang.Object
- - opennlp.tools.util.XmlUtil

-     public class XmlUtil
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XmlUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static DocumentBuilder` | `createDocumentBuilder()` Create a new `DocumentBuilder` which processes XML securely.
    `static SAXParser` | `createSaxParser()` Create a new `SAXParser` which processes XML securely.

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

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

- - ### Constructor Detail

    - #### XmlUtil

          public XmlUtil()

  - ### Method Detail

    - #### createDocumentBuilder

          public static DocumentBuilder createDocumentBuilder()

      Create a new `DocumentBuilder` which processes XML securely.
      Returns:
        A valid `DocumentBuilder` instance.
      Throws:
        `IllegalStateException` - Thrown if errors occurred creating the builder.

    - #### createSaxParser

          public static SAXParser createSaxParser()

      Create a new `SAXParser` which processes XML securely.
      Returns:
        A valid `SAXParser` instance.
      Throws:
        `IllegalStateException` - Thrown if errors occurred creating the parser.

Copyright © 2026 The Apache Software Foundation. All rights reserved.