|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.maven.html2xdoc.Html2XdocBean
public class Html2XdocBean
A simple bean for converting a HTML document into an XDoc compliant XML document. This could be done via XSLT but is a little more complex than it might first appear so its done via Java code instead.
Constructor Summary | |
---|---|
Html2XdocBean()
|
Method Summary | |
---|---|
protected void |
addSections(org.dom4j.Element output,
org.dom4j.Element body)
Iterates thorugh the given body looking for h1, h2, h3 nodes and creating the associated section elements. |
protected org.dom4j.Node |
cloneNode(org.dom4j.Node node)
Normalizes the whitespace of any Elements |
org.dom4j.Document |
convert(org.dom4j.Document html)
Converts the given HTML document into the corresponding XDoc format of XML |
protected int |
determineHeadingLevel(org.dom4j.Node node)
Determines the heading level of the node. |
protected List |
getBodyContent(List content)
Returns a copy of the body content, removing any whitespace from the beginning and end. |
protected String |
getSectionText(org.dom4j.Node node)
|
protected boolean |
isCharacterData(org.dom4j.Node node)
Specifies whether the node is character data and should be passed as straight text to the resultant html. |
protected boolean |
isHeading(org.dom4j.Node node)
Specifies whether the node is a heading node. |
protected boolean |
isPre(org.dom4j.Node node)
|
protected boolean |
isTextFormatting(org.dom4j.Node node)
Specifies whether the node is a text modifying construct that should be passed as is to the resultant html. |
protected boolean |
isWhitespace(org.dom4j.Node node)
|
protected void |
makeSection(org.dom4j.Element output,
org.dom4j.Node node)
Creates a section or subsection as necessary based on the node for the output document. |
protected boolean |
needsNewSection(org.dom4j.Node node)
Determines if a new section is needed which is based on whether the node's a heading level and equal to or less than the current section's heading level. |
protected boolean |
shouldBreakPara(org.dom4j.Node node)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Html2XdocBean()
Method Detail |
---|
public org.dom4j.Document convert(org.dom4j.Document html)
html
- the input html document
protected void addSections(org.dom4j.Element output, org.dom4j.Element body)
output
- the output destinationbody
- the block of HTML markup to convertprotected boolean isTextFormatting(org.dom4j.Node node)
node
- the node to check
protected boolean isCharacterData(org.dom4j.Node node)
node
- the node to check
protected boolean isHeading(org.dom4j.Node node)
node
- the node to check
protected int determineHeadingLevel(org.dom4j.Node node)
node
- the node to check
protected void makeSection(org.dom4j.Element output, org.dom4j.Node node)
output
- the output document to attach the sectionnode
- the node to base making a section onprotected String getSectionText(org.dom4j.Node node)
protected boolean needsNewSection(org.dom4j.Node node)
node
- the node to check
protected boolean shouldBreakPara(org.dom4j.Node node)
protected List getBodyContent(List content)
content
- the content node list to obtain body content from
protected boolean isPre(org.dom4j.Node node)
node
- the node to check
protected boolean isWhitespace(org.dom4j.Node node)
node
- the node to check
protected org.dom4j.Node cloneNode(org.dom4j.Node node)
node
- the node to clone
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |