[jira] Created: (XMLBEANS-189) namespace attributes gets lost when a XMLBean node is converted to DOM

View: New views
4 Messages — Rating Filter:   Alert me  

[jira] Created: (XMLBEANS-189) namespace attributes gets lost when a XMLBean node is converted to DOM

by JIRA xmlbeans-dev@xml.apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

namespace attributes gets lost when a XMLBean node is converted to DOM
-----------------------------------------------------------------------

         Key: XMLBEANS-189
         URL: http://issues.apache.org/jira/browse/XMLBEANS-189
     Project: XMLBeans
        Type: Bug
  Components: DOM  
    Versions: Version 2    
    Reporter: daryoush mehrtash
 Attachments: DOMNamespaceTest.java

When I create a "Schema" object I get the name space attribute
   xmlns="http://www.w3.org/2001/XMLSchema"
in the Object, but when I convert this to DOM node the attribute is not present.  I have attached a simple program to reproduce the problem.    When I run the following code:

    public static void main(String[] args) {
        SchemaDocument schema1 = SchemaDocument.Factory.newInstance();
        schema1.addNewSchema();
        System.out.println("Schema in XMLBeans" + schema1);
       
        System.out.println("Schema as DOM Node");
        Node node = schema1.getDomNode();
        node = node.getFirstChild();
        System.out.println("Node Name: " + node.getNodeName());
        System.out.println("Attributes: ");
        NamedNodeMap nnm = node.getAttributes();
        if (nnm != null) {
            int len = nnm.getLength();
            Attr attr;
            for (int i = 0; i < len; i++) {
                attr = (Attr) nnm.item(i);
                System.out.println("\t " + attr.getNodeName() + "=\"" + attr.getNodeValue() + '"');
            }
        }
        System.out.println("End of Attributes");  
    }




my output is:

Schema in XMLBeans<schema xmlns="http://www.w3.org/2001/XMLSchema"/>
Schema as DOM Node
Node Name: schema
Attributes:
End of Attributes


I expected teh xmlns=.... to show up as attribute of the dom node.


--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


[jira] Updated: (XMLBEANS-189) namespace attributes gets lost when a XMLBean node is converted to DOM

by JIRA xmlbeans-dev@xml.apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

     [ http://issues.apache.org/jira/browse/XMLBEANS-189?page=all ]

daryoush mehrtash updated XMLBEANS-189:
---------------------------------------

    Attachment: DOMNamespaceTest.java

> namespace attributes gets lost when a XMLBean node is converted to DOM
> ----------------------------------------------------------------------
>
>          Key: XMLBEANS-189
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-189
>      Project: XMLBeans
>         Type: Bug
>   Components: DOM
>     Versions: Version 2
>     Reporter: daryoush mehrtash
>  Attachments: DOMNamespaceTest.java
>
> When I create a "Schema" object I get the name space attribute
>    xmlns="http://www.w3.org/2001/XMLSchema"
> in the Object, but when I convert this to DOM node the attribute is not present.  I have attached a simple program to reproduce the problem.    When I run the following code:
>     public static void main(String[] args) {
>         SchemaDocument schema1 = SchemaDocument.Factory.newInstance();
>         schema1.addNewSchema();
>         System.out.println("Schema in XMLBeans" + schema1);
>        
>         System.out.println("Schema as DOM Node");
>         Node node = schema1.getDomNode();
>         node = node.getFirstChild();
>         System.out.println("Node Name: " + node.getNodeName());
>         System.out.println("Attributes: ");
>         NamedNodeMap nnm = node.getAttributes();
>         if (nnm != null) {
>             int len = nnm.getLength();
>             Attr attr;
>             for (int i = 0; i < len; i++) {
>                 attr = (Attr) nnm.item(i);
>                 System.out.println("\t " + attr.getNodeName() + "=\"" + attr.getNodeValue() + '"');
>             }
>         }
>         System.out.println("End of Attributes");  
>     }
> my output is:
> Schema in XMLBeans<schema xmlns="http://www.w3.org/2001/XMLSchema"/>
> Schema as DOM Node
> Node Name: schema
> Attributes:
> End of Attributes
> I expected teh xmlns=.... to show up as attribute of the dom node.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


[jira] Commented: (XMLBEANS-189) namespace attributes gets lost when a XMLBean node is converted to DOM

by JIRA xmlbeans-dev@xml.apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/XMLBEANS-189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12772378#action_12772378 ]

Jacob Danner commented on XMLBEANS-189:
---------------------------------------

This only appears to be an issue using the impl schemaDocument type

> namespace attributes gets lost when a XMLBean node is converted to DOM
> ----------------------------------------------------------------------
>
>                 Key: XMLBEANS-189
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-189
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: DOM
>    Affects Versions: Version 2
>            Reporter: daryoush mehrtash
>         Attachments: DOMNamespaceTest.java
>
>
> When I create a "Schema" object I get the name space attribute
>    xmlns="http://www.w3.org/2001/XMLSchema"
> in the Object, but when I convert this to DOM node the attribute is not present.  I have attached a simple program to reproduce the problem.    When I run the following code:
>     public static void main(String[] args) {
>         SchemaDocument schema1 = SchemaDocument.Factory.newInstance();
>         schema1.addNewSchema();
>         System.out.println("Schema in XMLBeans" + schema1);
>        
>         System.out.println("Schema as DOM Node");
>         Node node = schema1.getDomNode();
>         node = node.getFirstChild();
>         System.out.println("Node Name: " + node.getNodeName());
>         System.out.println("Attributes: ");
>         NamedNodeMap nnm = node.getAttributes();
>         if (nnm != null) {
>             int len = nnm.getLength();
>             Attr attr;
>             for (int i = 0; i < len; i++) {
>                 attr = (Attr) nnm.item(i);
>                 System.out.println("\t " + attr.getNodeName() + "=\"" + attr.getNodeValue() + '"');
>             }
>         }
>         System.out.println("End of Attributes");  
>     }
> my output is:
> Schema in XMLBeans<schema xmlns="http://www.w3.org/2001/XMLSchema"/>
> Schema as DOM Node
> Node Name: schema
> Attributes:
> End of Attributes
> I expected teh xmlns=.... to show up as attribute of the dom node.

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


[jira] Commented: (XMLBEANS-189) namespace attributes gets lost when a XMLBean node is converted to DOM

by JIRA xmlbeans-dev@xml.apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/XMLBEANS-189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12772379#action_12772379 ]

Jacob Danner commented on XMLBEANS-189:
---------------------------------------

Working Sample
the xmlns shows up as an attribute in this case
 XmlObject schema1 = XmlObject.Factory.parse("<schema xmlns=\"http://foo\" bar=\"bam\" />");
        System.out.println("Schema in XMLBeans" + schema1);

        System.out.println("Schema as DOM Node");
        Node node = schema1.getDomNode();
        node = node.getFirstChild();
        System.out.println("Node Name: " + node.getNodeName());
        System.out.println("Node NS: " + node.getNamespaceURI()+"-"+node.getNodeValue());
        System.out.println("Attributes: ");
        NamedNodeMap nnm = node.getAttributes();
        if (nnm != null) {
            int len = nnm.getLength();
            Attr attr;
            for (int i = 0; i < len; i++) {
                attr = (Attr) nnm.item(i);
                System.out.println("\t " + attr.getNodeName() + "=\"" + attr.getNodeValue() + '"');
            }
        }
        System.out.println("End of Attributes");

> namespace attributes gets lost when a XMLBean node is converted to DOM
> ----------------------------------------------------------------------
>
>                 Key: XMLBEANS-189
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-189
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: DOM
>    Affects Versions: Version 2
>            Reporter: daryoush mehrtash
>         Attachments: DOMNamespaceTest.java
>
>
> When I create a "Schema" object I get the name space attribute
>    xmlns="http://www.w3.org/2001/XMLSchema"
> in the Object, but when I convert this to DOM node the attribute is not present.  I have attached a simple program to reproduce the problem.    When I run the following code:
>     public static void main(String[] args) {
>         SchemaDocument schema1 = SchemaDocument.Factory.newInstance();
>         schema1.addNewSchema();
>         System.out.println("Schema in XMLBeans" + schema1);
>        
>         System.out.println("Schema as DOM Node");
>         Node node = schema1.getDomNode();
>         node = node.getFirstChild();
>         System.out.println("Node Name: " + node.getNodeName());
>         System.out.println("Attributes: ");
>         NamedNodeMap nnm = node.getAttributes();
>         if (nnm != null) {
>             int len = nnm.getLength();
>             Attr attr;
>             for (int i = 0; i < len; i++) {
>                 attr = (Attr) nnm.item(i);
>                 System.out.println("\t " + attr.getNodeName() + "=\"" + attr.getNodeValue() + '"');
>             }
>         }
>         System.out.println("End of Attributes");  
>     }
> my output is:
> Schema in XMLBeans<schema xmlns="http://www.w3.org/2001/XMLSchema"/>
> Schema as DOM Node
> Node Name: schema
> Attributes:
> End of Attributes
> I expected teh xmlns=.... to show up as attribute of the dom node.

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