[
https://issues.apache.org/jira/browse/AXIOM-509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17443348#comment-17443348
]
Kyla Miller commented on AXIOM-509:
-----------------------------------
When will 1.3.1 be released? This bug is a showstopper for us and we cannot
proceed until we get the fix.
> Reading and writing a file with & outputs &
> -----------------------------------------------
>
> Key: AXIOM-509
> URL: https://issues.apache.org/jira/browse/AXIOM-509
> Project: Axiom
> Issue Type: Bug
> Components: Core Model
> Affects Versions: 1.3.0
> Reporter: Kyla Miller
> Assignee: Andreas Veithen
> Priority: Blocker
> Fix For: 1.3.1
>
>
> On some documents when an element contains a mixture of elements and 2 or
> more text nodes and one of those text nodes contains an & then when the
> document is written out it writes out & instead of &. This causes the
> document to be invalid when it is read in the next time because & should be
> & in XML. Take this simple case (notice there is a space after the entry
> element):
> <entry> <ref:pagenum="4469"/> SUBTOTAL SYSTEM DEVELOPMENT & DEMONSTRATION
> </entry>
> This is valid XML but when it is written back out it is:
> <entry> <ref:pagenum="4469"/> SUBTOTAL SYSTEM DEVELOPMENT & DEMONSTRATION
> </entry>
> This is not valid XML and will cause the document to fail when it is read in
> the next time. I have not found a way to work around this yet.
>
> To read the document in
>
> XMLInputFactory xmlFactory = XMLInputFactory.newInstance();
>
> xmlFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES,
> false);
> xmlFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false);
>
> xmlFactory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, false);
> xmlFactory.setProperty(XMLInputFactory.IS_COALESCING, true);
>
> XMLStreamReader xmlStreamReader =
> xmlFactory.createXMLStreamReader(inputStream, encodingFormat);
> OMXMLParserWrapper staxOMBuilder =
> OMXMLBuilderFactory.createStAXOMBuilder(xmlStreamReader);
> omDocument = staxOMBuilder.getDocument();
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]