You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "Gennady Shumakher (JIRA)" <ji...@apache.org> on 2007/09/18 16:49:43 UTC

[jira] Created: (WSCOMMONS-254) AXIOM DOM based implementation fails to parse documents that start with xml comment.

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.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


[jira] Commented: (WSCOMMONS-254) AXIOM DOM based implementation fails to parse documents that start with xml comment.

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Resolved: (WSCOMMONS-254) AXIOM DOM based implementation fails to parse documents that start with xml comment.

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen resolved WSCOMMONS-254.
---------------------------------------

    Resolution: Fixed
      Assignee: Andreas Veithen

> 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
>            Assignee: Andreas Veithen
>
> 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.