Class JsoupXmlParser
- java.lang.Object
-
- com.itextpdf.styledxmlparser.node.impl.jsoup.JsoupXmlParser
-
- All Implemented Interfaces:
IXmlParser
public class JsoupXmlParser extends java.lang.Object implements IXmlParser
Class that uses JSoup to parse HTML.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger
logger
The logger.
-
Constructor Summary
Constructors Constructor Description JsoupXmlParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IDocumentNode
parse(java.io.InputStream xmlStream, java.lang.String charset)
Parses XML provided as anInputStream
and an encoding.IDocumentNode
parse(java.lang.String xml)
Parses XML provided as aString
.private INode
wrapJsoupHierarchy(Node jsoupNode)
Wraps JSoup nodes into pdfHTMLINode
classes.
-
-
-
Method Detail
-
parse
public IDocumentNode parse(java.io.InputStream xmlStream, java.lang.String charset) throws java.io.IOException
Description copied from interface:IXmlParser
Parses XML provided as anInputStream
and an encoding.- Specified by:
parse
in interfaceIXmlParser
- Parameters:
xmlStream
- the Xml streamcharset
- the character set. Ifnull
then parser should detect encoding from stream.- Returns:
- a document node
- Throws:
java.io.IOException
- Signals that an I/O exception has occurred.
-
parse
public IDocumentNode parse(java.lang.String xml)
Description copied from interface:IXmlParser
Parses XML provided as aString
.- Specified by:
parse
in interfaceIXmlParser
- Parameters:
xml
- the Xml string- Returns:
- a document node
-
-