Package org.docx4j.convert.out.html
Class TagSingleBox
java.lang.Object
org.docx4j.convert.out.html.SdtTagHandler
org.docx4j.convert.out.html.TagSingleBox
In Word, adjacent paragraphs with the same borders are enclosed in a single border
(unless bullets/numbering apply).
Similarly with shading. (If the 2 paragraphs are shaded different colors, then the
color of the first extends to the start of the second, so there is no white strip
between them).
To do the same in HTML, Containerization puts matching paragraphs into a content
control.
It is the job of this class to make a div out of that content control, and
set the border/shading on that as a style, copying the style value from
the first paragraph enclosed.
TODO: Note that there will typically be 2 content controls and therefore divs,
one for borders and one for shading. But the style will be the same on
each, so one is redundant.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate ElementcreateDiv(Document document, DocumentFragment docfrag, Node n) private NodegetNodeByName(String name, Node n) toNode(WordprocessingMLPackage wmlPackage, SdtPr sdtPr, HashMap<String, String> tagMap, Node resultSoFar) toNode(WordprocessingMLPackage wmlPackage, SdtPr sdtPr, HashMap<String, String> tagMap, NodeIterator childResults) Methods inherited from class org.docx4j.convert.out.html.SdtTagHandler
attachContents, attachContents, getAlias
-
Field Details
-
log
private static org.slf4j.Logger log
-
-
Constructor Details
-
TagSingleBox
public TagSingleBox()
-
-
Method Details
-
createDiv
private Element createDiv(Document document, DocumentFragment docfrag, Node n) throws ParserConfigurationException, IOException, SAXException, jakarta.xml.bind.JAXBException - Throws:
ParserConfigurationExceptionIOExceptionSAXExceptionjakarta.xml.bind.JAXBException
-
getNodeByName
-
toNode
public Node toNode(WordprocessingMLPackage wmlPackage, SdtPr sdtPr, HashMap<String, String> tagMap, NodeIterator childResults) throws TransformerException- Specified by:
toNodein classSdtTagHandler- Throws:
TransformerException
-
toNode
public Node toNode(WordprocessingMLPackage wmlPackage, SdtPr sdtPr, HashMap<String, String> tagMap, Node resultSoFar) throws TransformerException- Specified by:
toNodein classSdtTagHandler- Throws:
TransformerException
-