You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Davanum Srinivas (JIRA)" <ji...@apache.org> on 2007/02/01 03:31:05 UTC

[jira] Updated: (AXIS2-2068) StAXOMBuilder is stripping off namspace prefix's from attributes that need namespace qualification

     [ https://issues.apache.org/jira/browse/AXIS2-2068?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Davanum Srinivas updated AXIS2-2068:
------------------------------------

    Assignee: Davanum Srinivas

> StAXOMBuilder is stripping off namspace prefix's from attributes that need namespace qualification
> --------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2068
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2068
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: databinding
>         Environment: Using Axis2-1.1.1 on Fedora Core 4.
>            Reporter: Lucas Theisen
>         Assigned To: Davanum Srinivas
>            Priority: Critical
>         Attachments: omserializerutil_patch.txt, TestStAXOMBuilder.java
>
>
> Here is a code sample:
> public class TestStAXOMBuilder {
>     /**
>      * @param args
>      */
>     public static void main( String[] args ) throws Exception {
>         String xmlString = "<root xmlns='http://custom.com'><node cust:id='123' xmlns:cust='http://custom.com' /></root>";
>         org.apache.xmlbeans.XmlObject param = org.apache.xmlbeans.XmlObject.Factory.parse( xmlString );
>         
>         // print out the object before it gets processed
>         System.out.println( "before - '" + param.toString( ) + "'" );
>         
>         // copied code from the generated stub class toOM method
>         org.apache.axiom.om.impl.builder.StAXOMBuilder builder = new org.apache.axiom.om.impl.builder.StAXOMBuilder(
>                 org.apache.axiom.om.OMAbstractFactory.getOMFactory( ),
>                 new org.apache.axis2.util.StreamWrapper( param
>                         .newXMLStreamReader( ) ) );
>         org.apache.axiom.om.OMElement documentElement = builder
>                 .getDocumentElement( );
>         ((org.apache.axiom.om.impl.OMNodeEx) documentElement).setParent( null );
>         // end copied code
>         // now print the object after it has been processed
>         System.out.println( "after - '" + documentElement.toString( ) + "'" );
>     }
> }
> The output I get from running this is:
> before - '<root xmlns="http://custom.com">
>   <node cust:id="123" xmlns:cust="http://custom.com"/>
> </root>'
> after - '<root xmlns="http://custom.com"><node xmlns:cust="http://custom.com" id="123" /></root>'
> Notice that the namespace prefix "cust:" is removed from the "id" attribute therby making this an invalid xml.

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org