It is currently Mon Jan 13, 2025 5:48 am
public static void main(String[] args) throws Exception {
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
MainDocumentPart mdp = wordMLPackage.getMainDocumentPart();
StyleDefinitionsPart sdp = new StyleDefinitionsPart();
sdp.unmarshalDefaultStyles();
mdp.addTargetPart(sdp);
Styles styles = sdp.getJaxbElement();
java.util.List<Object> nodeList = mdp.getJAXBNodesViaXPath("//styles/style",styles,false);
for (int i = 0; i < nodeList.size(); i++) {
Style style = (Style) nodeList.get(i);
String styleId = style.getStyleId();
System.out.println(styleId);
}
}
Total posts 10116 • Total topics 2845 • Total members 2076