net.i2p.router.news

## Class XMLParser

- java.lang.Object
- - org.cybergarage.xml.Parser
  - - org.cybergarage.xml.parser.JaxpParser
    - - net.i2p.router.news.XMLParser

-     public class XMLParser
      extends JaxpParser

  Enhanced XML parser for I2P news content with XHTML support.

  Extends the base JaxpParser to properly handle mixed text and subnodes in XHTML content while maintaining both output types. Overrides default parsing behavior to ensure correct handling of text nodes and element separation.

  Provides custom output methods that recognize special text nodes and uses empty entities for self-closing tags to prevent malformed HTML output.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `TEXT_NAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XMLParser(I2PAppContext ctx)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Node` | `parse(Node parentNode, Node domNode, int rank)` Modified from UPnP JaxpParser
    `static void` | `toString(StringBuilder buf, Node node)` A replacement for Node.toString(), which does not recognize #text.

    - ### Methods inherited from class org.cybergarage.xml.parser.JaxpParser

      `parse, parse`

    - ### Methods inherited from class org.cybergarage.xml.Parser

      `parse, parse, parse`

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

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

- - ### Field Detail

    - #### TEXT_NAME

          public static final String TEXT_NAME

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### XMLParser

          public XMLParser(I2PAppContext ctx)

  - ### Method Detail

    - #### parse

          public Node parse(Node parentNode,
                            Node domNode,
                            int rank)

      Modified from UPnP JaxpParser
      Overrides:
        `parse` in class `JaxpParser`
      Parameters:
        `parentNode` - null if at top
        `rank` - parse level, only for debug
        `domNode` - the DOM node to parse
      Returns:
        the parsed node, or the parent node, unused except at top level

    - #### toString

          public static void toString(StringBuilder buf,
                                      Node node)

      A replacement for Node.toString(), which does not recognize #text.