// Why print fragment instead of <w:t>? CTText tmpTextNode = CTText.Factory.newInstance(); tmpTextNode.setStringValue("A"); XmlOptions opts = new XmlOptions(); opts.setSaveOuter(); opts.setSaveNoXmlDecl(); System.out.println(tmpTextNode.xmlText(opts));
Apache POI 3.17 is over 3 years old now - http://poi.apache.org/devel/history/changes-3x.html#3.17 . A large number of fixes have been done since then, see http://poi.apache.org/changes.html Can you please try again with a recent supported version, and see if the bug still remains?
Hi Nick, Before I invest a lot of time in upgrading, can you tell me what's the desried behaviour? Should it print <w:t>... or <xml-fragment>... ? Can you tell me what these 6 lines print in your updated POI?
Hi, NadavB I am not sure if it can be done: output <w:t>? But you can contact xml String by yourself and pay attention the "xmlns" attribute.
Hi Sayi, If I'm not wrong, CTText is an XML-bean represenation of a <w:t> xml node, isn't it? If so, I'm just trying to print out the node, as xml-string representation of the CTText element.
xmlText is a generated method - we use XMLBeans to generate CTText. xmlText has behaved this way for years - so there is no recent regression. XMLBeans 2.6.0 has this behaviour (released 2012) - as does recent XMLBeans releases. I moved this to https://issues.apache.org/jira/browse/XMLBEANS-573