[ 
https://issues.apache.org/jira/browse/WSCOMMONS-254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654155#action_12654155
 ] 

Andreas Veithen commented on WSCOMMONS-254:
-------------------------------------------

Fixed in trunk.

> AXIOM DOM based implementation fails to parse documents that start with xml 
> comment.
> ------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-254
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-254
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Gennady Shumakher
>
> DOM based AXIOM implementation fails when the parsed document starts with xml 
> comment.
> Code example:
>               String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- 
> comment --><store><book><id >1</id><title >Book A</title></book></store>";
>               ByteArrayInputStream bais = new 
> ByteArrayInputStream(xml.getBytes());
>               XMLStreamReader reader = 
> XMLInputFactory.newInstance().createXMLStreamReader(bais);
>                 // Create dom builder
>               StAXOMBuilder doomBuilder = new 
> StAXOMBuilder(DOOMAbstractFactory.getOMFactory(), reader);
>               // Get the document element
>               OMElement newElem = doomBuilder.getDocumentElement();
>               if (!(newElem instanceof org.w3c.dom.Element))
>               {
>                       System.out.println("Failed to read a 
> org.w3c.dom.Element !!!");
>               }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to