Package org.jsoup.parser

Class XmlTreeBuilder

java.lang.Object
org.jsoup.parser.XmlTreeBuilder

public class XmlTreeBuilder extends Object
Use the XmlTreeBuilder when you want to parse XML without any of the HTML DOM rules being applied to the document.

Usage example: Document xmlDoc = Jsoup.parse(html, baseUrl, Parser.xmlParser());

Author:
Jonathan Hedley
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Parser
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    String
     
    protected void
    initialiseParse(Reader input, String baseUri, Parser parser)
     
    protected void
    popStackToClose(org.jsoup.parser.Token.EndTag endTag)
    If the stack contains an element with this tag's name, pop up the stack to remove the first occurrence.
    protected boolean
    process(org.jsoup.parser.Token token)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • parser

      protected Parser parser
  • Constructor Details

    • XmlTreeBuilder

      public XmlTreeBuilder()
  • Method Details

    • initialiseParse

      protected void initialiseParse(Reader input, String baseUri, Parser parser)
    • defaultNamespace

      public String defaultNamespace()
    • process

      protected boolean process(org.jsoup.parser.Token token)
    • popStackToClose

      protected void popStackToClose(org.jsoup.parser.Token.EndTag endTag)
      If the stack contains an element with this tag's name, pop up the stack to remove the first occurrence. If not found, skips.
      Parameters:
      endTag - tag to close