If the following conditions are met:
- text-padding format is used – see OutputFormat.setPadText(boolean)
- the XML document contains a node containing a mixture of text-nodes and other nodes
- at least one of the mentioned text-nodes is empty
... then method XMLWriter.writeElementContent(Element) may throw a StringIndexOutOfBoundsException.
The cause is that the code assumes that the text of a text-node is never empty. But if the text is empty, then an attempt to get the first character fails with the exception.
A suggested patch is attached.
patch.zip
If the following conditions are met:
... then method XMLWriter.writeElementContent(Element) may throw a StringIndexOutOfBoundsException.
The cause is that the code assumes that the text of a text-node is never empty. But if the text is empty, then an attempt to get the first character fails with the exception.
A suggested patch is attached.
patch.zip