Using java Syntax Highlighting
List<Object> texts = thisWordMLPackage.getMainDocumentPart()
.getJAXBNodesViaXPath(XPATH_TO_SELECT_TEXT_NODES, true);
CTAltChunk chunk = ... //Chunk creation works
//does not work
texts.set(index, chunk);
//does not work either
((JAXBElement) texts.get(index)).setValue(chunks);
// DOES WORK, but the list we receive with the .getContent() method is not congruent with the texts list, i.o.w the index from XPATH is != index of DocumentPart and the inserting is wrong.
thisWordMLPackage.getMainDocumentPart().getContent().set((index),chunk)
.getJAXBNodesViaXPath(XPATH_TO_SELECT_TEXT_NODES, true);
CTAltChunk chunk = ... //Chunk creation works
//does not work
texts.set(index, chunk);
//does not work either
((JAXBElement) texts.get(index)).setValue(chunks);
// DOES WORK, but the list we receive with the .getContent() method is not congruent with the texts list, i.o.w the index from XPATH is != index of DocumentPart and the inserting is wrong.
thisWordMLPackage.getMainDocumentPart().getContent().set((index),chunk)
Parsed in 0.014 seconds, using GeSHi 1.0.8.4
Is there a proper way to solve this? I am able to provide more information upon request, of course.
Thank you in advance,
Nico