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.LoggerloggerThe logger.
-
Constructor Summary
Constructors Constructor Description JsoupXmlParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IDocumentNodeparse(java.io.InputStream xmlStream, java.lang.String charset)Parses XML provided as anInputStreamand an encoding.IDocumentNodeparse(java.lang.String xml)Parses XML provided as aString.private INodewrapJsoupHierarchy(Node jsoupNode)Wraps JSoup nodes into pdfHTMLINodeclasses.
-
-
-
Method Detail
-
parse
public IDocumentNode parse(java.io.InputStream xmlStream, java.lang.String charset) throws java.io.IOException
Description copied from interface:IXmlParserParses XML provided as anInputStreamand an encoding.- Specified by:
parsein interfaceIXmlParser- Parameters:
xmlStream- the Xml streamcharset- the character set. Ifnullthen 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:IXmlParserParses XML provided as aString.- Specified by:
parsein interfaceIXmlParser- Parameters:
xml- the Xml string- Returns:
- a document node
-
-