Package org.jsoup.helper
Class W3CDom
java.lang.Object
org.jsoup.helper.W3CDom
Helper class to transform a
Document
to a org.w3c.dom.Document
,
for integration with toolsets that use the W3C DOM.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
Implements the conversion by walking the input. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSerialize a W3C document to a String.static String
Serialize a W3C document to a String.static Document
Converts a jsoup DOM to a W3C DOMvoid
Converts a jsoup document into the provided W3C Document.Convert a jsoup Document to a W3C Document.Canned default for HTML output.Canned default for XML output.(package private) static Properties
propertiesFromMap
(Map<String, String> map)
-
Field Details
-
factory
-
-
Constructor Details
-
W3CDom
public W3CDom()
-
-
Method Details
-
convert
Converts a jsoup DOM to a W3C DOM- Parameters:
in
- jsoup Document- Returns:
- W3C Document
-
asString
Serialize a W3C document to a String. Provide Properties to define output settings including if HTML or XML. If you don't provide the properties (null
), the output will be auto-detected based on the content of the document.- Parameters:
doc
- Documentproperties
- (optional/nullable) the output properties to use. SeeTransformer.setOutputProperties(Properties)
andOutputKeys
- Returns:
- Document as string
- See Also:
-
propertiesFromMap
-
OutputHtml
Canned default for HTML output. -
OutputXml
Canned default for XML output. -
methodMap
-
fromJsoup
Convert a jsoup Document to a W3C Document.- Parameters:
in
- jsoup doc- Returns:
- w3c doc
-
convert
Converts a jsoup document into the provided W3C Document. If required, you can set options on the output document before converting.- Parameters:
in
- jsoup docout
- w3c doc- See Also:
-
asString
Serialize a W3C document to a String. The output format will be XML or HTML depending on the content of the doc.- Parameters:
doc
- Document- Returns:
- Document as string
- See Also:
-