I'm trying to access all of the style which are present in styles.xml.
Using :
- Code: Select all
StyleDefinitionsPart sdp = wordMLPackage.getMainDocumentPart().getStyleDefinitionsPart();
List<Style> styleList = sdp.getJaxbElement().getStyle();
for (Style style : styleList) {
System.out.println(style.getName().getVal());
}
on a new almost empty docx, I've got this :
- Code: Select all
Normal
Default Paragraph Font
Normal Table
No List
Whereas, in the styles.xml, I found
- Code: Select all
<w:lsdException w:name="Normal" w:uiPriority="0" w:qFormat="1"/>
<w:lsdException w:name="heading 1" w:uiPriority="9" w:qFormat="1"/>
<w:lsdException w:name="heading 2" w:semiHidden="1" w:uiPriority="9" w:unhideWhenUsed="1" w:qFormat="1"/>
<w:lsdException w:name="heading 3" w:semiHidden="1" w:uiPriority="9" w:unhideWhenUsed="1" w:qFormat="1"/>
<w:lsdException w:name="heading 4" w:semiHidden="1" w:uiPriority="9" w:unhideWhenUsed="1" w:qFormat="1"/>
.......
</w:latentStyles>
How can I access all the latent style?