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 "Ruchith Udayanga Fernando (JIRA)" <ji...@apache.org> on 2006/08/18 14:13:14 UTC

[jira] Created: (WSCOMMONS-74) Incorrect namespace serialization

Incorrect namespace serialization
---------------------------------

                 Key: WSCOMMONS-74
                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
             Project: WS-Commons
          Issue Type: Bug
          Components: AXIOM
            Reporter: Ruchith Udayanga Fernando
            Priority: Blocker
         Attachments: SerializationTest.java

Hi All,

I noticed that axiom doesn't serialize namespaces correctly. 

1.) Namespaces in qualified elements
For example we should be able to produce the following xml with the code that follows:

<person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
  <name>John</name>
  <name>John12</name>
  <age>34</age>
</person1>

        OMFactory fac = OMAbstractFactory.getOMFactory();
        
        OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
        OMElement personElem = fac.createOMElement("person", ns);
        OMElement nameElem = fac.createOMElement("name", ns);
        nameElem.setText("John");
        
        OMElement ageElem = fac.createOMElement("age", ns);
        ageElem.setText("34");
        
        OMElement weightElem = fac.createOMElement("weight", ns);
        weightElem.setText("50");
        
        
        //Add children to the person element
        personElem.addChild(nameElem);
        personElem.addChild(ageElem);
        personElem.addChild(weightElem);
        
        String xml = personElem.toString();

But right now this produces the following :

<person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>

The repetition of the default namespace should be avoided.

This is the same even if we used a prefixed namespace.

2.) Unqualified elements among qualified elements

        
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
        OMElement personElem = fac.createOMElement("person", ns);

        //Create and add an unqualified element
        OMElement nameElem = fac.createOMElement("name", null);
        nameElem.setText("John");
        personElem.addChild(nameElem);

        OMElement ageElem = fac.createOMElement("age", ns);
        ageElem.setText("34");
        
        OMElement weightElem = fac.createOMElement("weight", ns);
        weightElem.setText("50");

        personElem.addChild(ageElem);
        personElem.addChild(weightElem);

        System.out.println(personElem);

The above should produce the following :

<person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>

But AXIOM right now produces :

<person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>

What do u folks think?

Thanks,
Ruchith

p.s. Added a test case

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


[jira] Commented: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=comments#action_12430235 ] 
            
Rich Scheuerle commented on WSCOMMONS-74:
-----------------------------------------

I am still confused by Eran's last set of comments.  Were there some comments outside this issue ?

Glen's rule:  createOMElement("localName", null) should be an unqualified element (no namespace).
     * Problem: Making such a change will break exisiting code and tests.

Eran's rule and current code: createOMElement("localName", null) should create an element in the default namespace (the namespace defined by the xmlns=<ns> in scope).  This essentially means that the choice
      of the namespace is deferred until the element is attached or until setDefaultNamespace is used on the element. 
       * Problem:  This rules means that the namespace of the element cannot be determined without contextural information about the element's scope.  As the element moves around
                             the namespace changes.

-----------------------------------------------

Ruchith,

I can look into the problem with the security xml.  Are you sure this is a serialization problem (and not a model problem) ?
I have not debugged, but here is my suspicion.
   A)  The Signature element is qualified and using the default namespace to define its namespace.
   B) The Algorithm attribute of CanonicalizationMethod is an unqualified attribute.  This may be forcing a OMNamespace("", "") onto the 
        OMElement for CanonicalizationMethod.
   C) The serialization logic writes out all of the namespaces ...including the one for OMNamespace("", "").  The serialization logic cannot (and never could) determine
        why a namespace gets into the declared namespace list.
    D) xmlns="" is written out.

The root of the problem is that an attribute (per schema spec) can never be defined with a default namespace.  The corrollary is that an attribute refrence witout a prefix is
always an unqualified attribute.  

A quick inspection of the code indicates that the OMElementImpl logic is not aware of this distinction.   The solution may be:
         a) make sure that adding an Attribute without a prefix always adds an unqualified Attribute.
         b) adding an unqualified Attribute SHOULD NOT change the declared namespaces on the element.

I am away from work on personal reasons.  It will be several days before I can do more investigation.  If someone wants to jump in and try a solution, please be my guest.
  



> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: axiom_api_patch.txt, axiom_impl_patch.txt, axiom_test_patch.txt, jaxsw_test_patch.txt, SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Commented: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=comments#action_12429710 ] 
            
Rich Scheuerle commented on WSCOMMONS-74:
-----------------------------------------

Eran thanks for the clarification. 

Everyone, let me try to clarify the rule for createOMElement("foo", null).  I don't believe there is any breakage here.

---------------------------
Model Rule for createOMElement("name", null):

The element "name" uses the default namespace.  If the default namespace is not set on "name" then then default namespace in scope is used.  If the default namespace is not set in the scope, then "name" is an unqualified name.  This is way the model works today (ignore the OMSerializerUtils code...look at the object model).  If you ask for the namespace of nameElem in Ruchith's code above it will be null, because the default namespace is never set.

----------------------------
Serialization Rule for createOMElement("name", null);

The serialization rule must be consistent with the model rule.  Ruchith's sample serialization above is consistent with the model.  I don't see anything the prior OMSerializerUtils that would have changed this.  In the old OMSerializerUtils, the abridged logic of serializeStartPart is:

A) Get the namespace of the element. For the example above this will be null for "name".
B) Drop into  the section where the startElement is written...plus a rather obscure comment:

writer.writeStartElement(element.getLocalName());

            /** // we need to check whether there's a default namespace visible at this point because
             // otherwise this element will go into that namespace unintentionally. So we check
             // whether there is a default NS visible and if so turn it off.
             if (writer.getNamespaceContext().getNamespaceURI("") != null) {
             writer.writeDefaultNamespace("");
             }   */

C) Call serializeNamespaces....There are no declared namespaces on "name" so nothing will be done.

So the outcome is the same for both the old and new code....and the model is consistent with the serialization logic.  Please let me know if you believe that I 
am mistaken in my analysis.

Aside:  I don't disagree with the commented out code, but it is more than a serialization issue.  It could also be an issue with exposing the OM as a XMLStreamReader if this part of the OM is a fragment of another OM...  A possible (untested) solution is to change OMElement.getNamespace() 
from:
public OMNamespace getNamespace() throws OMException {
        return ns != null ? ns : getDefaultNamespace();
    }
to;
public OMNamespace getNamespace() throws OMException {
        OMNamespace resultNS = ns != null ? ns : getDefaultNamespace();
         // If attached and there is no namespace, this must be an unqualified namespace
         if (resultNS  == null && getParent() != null) {
                 resultNS = declareDefaultNamespace("\"\"");
          }
          return resultNS;
    }

-------------------------------------------
Eran,

Yes I got the hint.  I am the one that removed the comments when I refactored the code.  The code was refactored because it did not comply with the
StaX specification with regards to the timing of the setPrefix and writePrefix methods.  It is unfortunate that the STaX specfication did not do a better job with this important concern.  Now we have the situation where different StaX implementations have different interpretations.  sigh

-------------------------------------------




> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: axiom_api_patch.txt, axiom_impl_patch.txt, axiom_test_patch.txt, jaxsw_test_patch.txt, SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Commented: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Eran Chinthaka (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=comments#action_12430082 ] 
            
Eran Chinthaka commented on WSCOMMONS-74:
-----------------------------------------

First appologies for bit of misleading/wrong comment above (http://issues.apache.org/jira/browse/WSCOMMONS-74#action_12429456).

Anyway, having looked at the code Rich had pasted, now I also lean towards Glen's comment. If an element is defined with null as the namespace, then the element should not have an explicit namespace. In other words it should be in default *default* namespace. Which means the following code fragment is correct. 

 if (writer.getNamespaceContext().getNamespaceURI("") != null) {
             writer.writeDefaultNamespace("");
 }

BTW, I can not understand why the comment there was obscure. IIRC, I put that comment and appologies if some of you can not understand that. Its my bad but I tried my level best to explain it from the little bit of English I know. 



> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: axiom_api_patch.txt, axiom_impl_patch.txt, axiom_test_patch.txt, jaxsw_test_patch.txt, SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Commented: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=comments#action_12429017 ] 
            
Rich Scheuerle commented on WSCOMMONS-74:
-----------------------------------------

I agree with the assessment.  I will investigate the situation and have a comeback Friday or Saturday.

> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Commented: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Ruchith Udayanga Fernando (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=comments#action_12429414 ] 
            
Ruchith Udayanga Fernando commented on WSCOMMONS-74:
----------------------------------------------------

+1 Glen !

Hence I guess the testUnqualifiedElements() case in the attached test should hold.

Thanks,
Ruchith

> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Resolved: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Eran Chinthaka (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=all ]

Eran Chinthaka resolved WSCOMMONS-74.
-------------------------------------

    Resolution: Fixed
      Assignee: Eran Chinthaka  (was: Rich Scheuerle)

Fixed in current in svn. Added Ruchith's initial tests and they are successful as well.

> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Eran Chinthaka
>            Priority: Blocker
>         Attachments: axiom_api_patch.txt, axiom_impl_patch.txt, axiom_test_patch.txt, jaxsw_test_patch.txt, SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Assigned: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Eran Chinthaka (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=all ]

Eran Chinthaka reassigned WSCOMMONS-74:
---------------------------------------

    Assignee: Rich Scheuerle

Rich,

Can you please look in to this? Seems the problem is in OMSerializer. 

> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Reopened: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Ruchith Udayanga Fernando (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=all ]

Ruchith Udayanga Fernando reopened WSCOMMONS-74:
------------------------------------------------

             
Please see my last note !

> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: axiom_api_patch.txt, axiom_impl_patch.txt, axiom_test_patch.txt, jaxsw_test_patch.txt, SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Work started: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=all ]

Work on WSCOMMONS-74 started by Rich Scheuerle.

> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Updated: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=all ]

Rich Scheuerle updated WSCOMMONS-74:
------------------------------------

    Attachment: axiom_api_patch.txt

> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: axiom_api_patch.txt, axiom_impl_patch.txt, axiom_test_patch.txt, SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Commented: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Glen Daniels (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=comments#action_12429413 ] 
            
Glen Daniels commented on WSCOMMONS-74:
---------------------------------------

Hi guys:

IMO, createOMElement("name", null) *should* create a non-qualified element.  Default namespaces are really more of an artifact of serialization than of the actual object model - in the infoset, an element is in a namespace or it's not, regardless as to whether that namespace is the current default.

So if you createOMElement("name", ns), then depending on whether ns is the current default or not, you'll get a different serialization.  But you should ALWAYS have the same QName.  Hence, using null should always get you an unqualified element.

--Glen


> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Commented: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=comments#action_12429461 ] 
            
Rich Scheuerle commented on WSCOMMONS-74:
-----------------------------------------

So based on my findings and Eran's and Jeff's comments, the existing createOMElement("localName", null) behavior will be retained.  I am adding some sparse javadoc to explain this.

If anyone thinks that a createOMElement("localName") method is necessary, please open a different JIRA issue.

scheu

> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: axiom_api_patch.txt, axiom_impl_patch.txt, axiom_test_patch.txt, jaxsw_test_patch.txt, SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Commented: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Ruchith Udayanga Fernando (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=comments#action_12430222 ] 
            
Ruchith Udayanga Fernando commented on WSCOMMONS-74:
----------------------------------------------------

Hi Rich,

I ran into a yet another OM serialization issue yesterday during the WS-SX interop. :-(

Consider the following XML: (Note the use of the default namespaces)

-----------------------------------START-----------------------------------
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
        <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
        <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
        <Reference URI="#uuid:a6dc659e-3dc3-4c0e-96ae-8fc74e533955">
                <Transforms xmlns="http://www.w3.org/2000/09/xmldsig#">
                        <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
                        <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                </Transforms>
                <DigestMethod xmlns="http://www.w3.org/2000/09/xmldsig#" Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
                <DigestValue xmlns="http://www.w3.org/2000/09/xmldsig#">iz9UsE7Y6hHExQFUiqhKOeangec=</DigestValue>
        </Reference>
</SignedInfo>
<SignatureValue>mnka0NeLIs1RIukOulge9Z82+MGPMbRztggTcsA8QzOMCmLHZQKuMU98VwHlNdUqW52RWiQJa4TWlc4tjV/2tehxWBu+r9AhD6MuIz64EIK5QNoEr3/mBX6GPVhSp8KzBFIFdDuaOv0Vfdqvkdh/bXKe/CBnzwJaXE6BocufVTE=</SignatureValue>
<KeyInfo>
        <X509Data>
                <X509Certificate>MIIDDDCCAfSgAwIBAgIQb6U6bec4ZHW96T5N2A/NdTANBgkqhkiG9w0BAQUFADAwMQ4wDAYDVQQKDAVPQVNJUzEeMBwGA1UEAwwVT0FTSVMgSW50ZXJvcCBUZXN0IENBMB4XDTA1MTAyNzAwMDAwMFoXDTE4MTAyNzIzNTk1OVowQjEOMAwGA1UECgwFT0FTSVMxIDAeBgNVBAsTF09BU0lTIEludGVyb3AgVGVzdCBDZXJ0MQ4wDAYDVQQDDAVXc3NJUDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2X9ZWiek/59vvg+l/lmzWjBYiqoOuSI+ms3ief7RyhPNh/IrGE3VwU67HsygNeavE06S6xNfcNWUNLqEdRmd/29WnubNH7hWJsqp7rn8g/mxNVkynCkJ1saKuD8ILiKfNg0e8UUE9QzwEz1fxw81OR0SbDitfTrDj8Q/ouCgEaUCAwEAAaOBkzCBkDAJBgNVHRMEAjAAMDMGA1UdHwQsMCowKKImhiRodHRwOi8vaW50ZXJvcC5iYnRlc3QubmV0L2NybC9jYS5jcmwwDgYDVR0PAQH/BAQDAgSwMB0GA1UdDgQWBBQb1AYE+P8ue/8qbgUJOKoyDXFqaTAfBgNVHSMEGDAWgBTAnSj8wes1oR3WqqqgHBpNwkkPDzANBgkqhkiG9w0BAQUFAAOCAQEAeltzyUHj+/0i3Hsj5XvWrJ7mF+zBFwp7E6CPLP/urfMdl1VFaBttOCcdWRrm8GI3KsGQMV6dpzAykl1JDO7T6IMSMYA1/YTsSH9S8xoubL/7IGYj3izKZ9LrV7fJJOHOerKLgIk/0X8DzH15jwel271s6Nh6DiXqU2Hf0YUmauLAH+rbiuNLlUKM5UkP4BtGqPw+6tvyaUOa3fzJs92WB+j5x91/xmvNg+ZTp+TEfyINM3wZAHwoIzXtEViopCRsXkmLr+IBGszmUpZnPd2QuqDSSkQhlZmUAuNVPCTBoNuWBX/tvvAw3a3jl+DXB+Fn2JbRpoUdvkgAWCAJ6hrKgA==</X509Certificate>
        </X509Data>
</KeyInfo>
</Signature>

-----------------------------------END-----------------------------------

When I read this into OM and serialize it, the serialized form is incorrect : (Note the use of xmlns="" in the following output).

-----------------------------------START-----------------------------------

<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
	<CanonicalizationMethod xmlns="" Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
	<SignatureMethod xmlns="" Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
	<Reference xmlns="" URI="#uuid:a6dc659e-3dc3-4c0e-96ae-8fc74e533955">
		<Transforms xmlns="http://www.w3.org/2000/09/xmldsig#">
			<Transform xmlns="" Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
			<Transform xmlns="" Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
		</Transforms>
		<DigestMethod xmlns="http://www.w3.org/2000/09/xmldsig#" Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
		<DigestValue xmlns="http://www.w3.org/2000/09/xmldsig#">iz9UsE7Y6hHExQFUiqhKOeangec=</DigestValue>
	</Reference>
</SignedInfo>
<SignatureValue>mnka0NeLIs1RIukOulge9Z82+MGPMbRztggTcsA8QzOMCmLHZQKuMU98VwHlNdUqW52RWiQJa4TWlc4tjV/2tehxWBu+r9AhD6MuIz64EIK5QNoEr3/mBX6GPVhSp8KzBFIFdDuaOv0Vfdqvkdh/bXKe/CBnzwJaXE6BocufVTE=</SignatureValue>
<KeyInfo>
	<X509Data>
		<X509Certificate>MIIDDDCCAfSgAwIBAgIQb6U6bec4ZHW96T5N2A/NdTANBgkqhkiG9w0BAQUFADAwMQ4wDAYDVQQKDAVPQVNJUzEeMBwGA1UEAwwVT0FTSVMgSW50ZXJvcCBUZXN0IENBMB4XDTA1MTAyNzAwMDAwMFoXDTE4MTAyNzIzNTk1OVowQjEOMAwGA1UECgwFT0FTSVMxIDAeBgNVBAsTF09BU0lTIEludGVyb3AgVGVzdCBDZXJ0MQ4wDAYDVQQDDAVXc3NJUDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2X9ZWiek/59vvg+l/lmzWjBYiqoOuSI+ms3ief7RyhPNh/IrGE3VwU67HsygNeavE06S6xNfcNWUNLqEdRmd/29WnubNH7hWJsqp7rn8g/mxNVkynCkJ1saKuD8ILiKfNg0e8UUE9QzwEz1fxw81OR0SbDitfTrDj8Q/ouCgEaUCAwEAAaOBkzCBkDAJBgNVHRMEAjAAMDMGA1UdHwQsMCowKKImhiRodHRwOi8vaW50ZXJvcC5iYnRlc3QubmV0L2NybC9jYS5jcmwwDgYDVR0PAQH/BAQDAgSwMB0GA1UdDgQWBBQb1AYE+P8ue/8qbgUJOKoyDXFqaTAfBgNVHSMEGDAWgBTAnSj8wes1oR3WqqqgHBpNwkkPDzANBgkqhkiG9w0BAQUFAAOCAQEAeltzyUHj+/0i3Hsj5XvWrJ7mF+zBFwp7E6CPLP/urfMdl1VFaBttOCcdWRrm8GI3KsGQMV6dpzAykl1JDO7T6IMSMYA1/YTsSH9S8xoubL/7IGYj3izKZ9LrV7fJJOHOerKLgIk/0X8DzH15jwel271s6Nh6DiXqU2Hf0YUmauLAH+rbiuNLlUKM5UkP4BtGqPw+6tvyaUOa3fzJs92WB+j5x91/xmvNg+ZTp+TEfyINM3wZAHwoIzXtEViopCRsXkmLr+IBGszmUpZnPd2QuqDSSkQhlZmUAuNVPCTBoNuWBX/tvvAw3a3jl+DXB+Fn2JbRpoUdvkgAWCAJ6hrKgA==</X509Certificate>
	</X509Data>
</KeyInfo>
</Signature>
-----------------------------------END-----------------------------------

Seems like OM serialization is still broken :-(. 
I'll reopen this issue.

Thanks,
Ruchith


> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: axiom_api_patch.txt, axiom_impl_patch.txt, axiom_test_patch.txt, jaxsw_test_patch.txt, SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Updated: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=all ]

Rich Scheuerle updated WSCOMMONS-74:
------------------------------------

    Attachment: jaxsw_test_patch.txt

Attaching the source changes, a beefed up test, and a jaxws test change that this new code exposed.

I ran both axis2 and axiom.

I will commit the changes in a few minutes.

> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: axiom_api_patch.txt, axiom_impl_patch.txt, axiom_test_patch.txt, jaxsw_test_patch.txt, SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Commented: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Eran Chinthaka (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=comments#action_12429480 ] 
            
Eran Chinthaka commented on WSCOMMONS-74:
-----------------------------------------

I strongly encouraged to see rev404977 (http://svn.apache.org/viewvc?view=rev&revision=404977) of serializeStartPart in OMSerialiazerUtil.java as it had all the comments about this (unfortunately they are all gone :( ). 
That had the exact implementation of what we discussed and agreed some time back. 

> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: axiom_api_patch.txt, axiom_impl_patch.txt, axiom_test_patch.txt, jaxsw_test_patch.txt, SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Commented: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Eran Chinthaka (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=comments#action_12429456 ] 
            
Eran Chinthaka commented on WSCOMMONS-74:
-----------------------------------------

Hang on guys.

Let me explain a lil bit abt this as I was involved in almost all the discussions related to OM since 1960s ;).

The meaning of OMElement omEle = fac.createOMElement("Foo", null) means, I don't care about the ns of this object, create an OMElement with null namespace. When we serialize this element Foo will be assigned to default namespace, which is automatic. Basically no ns prefix will be assigned to Foo

Putting the namespace when we create the OMElement was just a convenience method. But if we want work with default namespaces, there aren't any createOMElement method for that. You have to first create the OMElement then call declareDefaultNamespace. 

This was agreed sometime back I think (I can not find the mail or the comment I put in a commit)

So if we want to create what Ruchith wanted to do, this is the proper code fragment. 

If you to get 
<person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person> 

OMFactory fac = OMAbstractFactory.getOMFactory();
OMElement personElem = fac.createOMElement("person", null);
OMNamespace ns = personElem.declareDefaultNamespace("http://ws.apache.org/axis2/apacheconasia/06");
        
        //Create and add an unqualified element
        OMElement nameElem = fac.createOMElement("name", null);
        nameElem.declareDefaultNamespace("\"\"");
        nameElem.setText("John");
        personElem.addChild(nameElem);

        OMElement ageElem = fac.createOMElement("age", null); // even if this is ("age", ns) there is no change in 
                                                                                                                 // this case
        ageElem.setText("34");
        
        OMElement weightElem = fac.createOMElement("weight", ns);
        weightElem.setText("50");

        personElem.addChild(ageElem);
        personElem.addChild(weightElem); 


P.S. Rich you have six more days to go, I'm now 17 days after it :)


> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: axiom_api_patch.txt, axiom_impl_patch.txt, axiom_test_patch.txt, jaxsw_test_patch.txt, SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Commented: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=comments#action_12429435 ] 
            
Rich Scheuerle commented on WSCOMMONS-74:
-----------------------------------------

Though I agree in principle with Glenn's interpretation, it will add instability to existing code.

I made a quick change to OMElementImpl to interpret "null" as "unqualified" and 14 tests (in just Axiom) failed.

So what I will do is as follows:

1)  Make the changes necessary for this serialization defect.

2) I will change the javadoc to indicate that a "null" OMNamespace means "use the scoped default namespace"

----------------------------------------------

So for the "interpretation of null OMNamespace" I have the following suggestions..(A different JIRA should be opened to investigate if something other than (A) is desired.)

A) Change the javadoc to reflect the current behavior (i.e. use the scoped default namespace).
      Pros: No breakage
      Cons: Seems like a funny rule

B) Like (A) but also add factory methods to explictly create unqualified elements (i.e. createOMElement(localName))
       Pros: No breakage and better apis
       Cons: Still have the funny rule for null.

C) Like (B) except that the OMFactory/OMElementImpl  should assert that the ns is not null
        Pros: Good rule
        Cons: Breakage, but the breakage will be immediate and mostly limited to the Axiom/Apache.

Note: In the implementation, a unqualified element will have the OMNamespace {"", ""}.  There will never be a situation where an OMElement has a null for the namespace.








> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Updated: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=all ]

Rich Scheuerle updated WSCOMMONS-74:
------------------------------------

    Attachment: axiom_impl_patch.txt

> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: axiom_api_patch.txt, axiom_impl_patch.txt, axiom_test_patch.txt, SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Updated: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=all ]

Rich Scheuerle updated WSCOMMONS-74:
------------------------------------

    Attachment: axiom_test_patch.txt

> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: axiom_api_patch.txt, axiom_impl_patch.txt, axiom_test_patch.txt, SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Commented: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Eran Chinthaka (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=comments#action_12429657 ] 
            
Eran Chinthaka commented on WSCOMMONS-74:
-----------------------------------------

Seems problem is not fixed. Again what I stress is to go back to http://svn.apache.org/viewvc?view=rev&revision=404977 and see the behavior which was accepted by everyone. I can not exactly remember the reason behind someone *completly* replacing that logic, without doing proper changes to that. 

Its partly my fault as
  1. I didn't follow mails for some time as I was loaded with tons of other work and mails
  2. I haven't written *enough* comments on the code when I was implementig the code.

I'd rather encourage to re-visit the older code which I think Ruchith and Glen also agree to. Sorry Ruchith if I had made a confusing statement in my earlier comment (http://issues.apache.org/jira/browse/WSCOMMONS-74#action_12429456)

-- Chinthaka

> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: axiom_api_patch.txt, axiom_impl_patch.txt, axiom_test_patch.txt, jaxsw_test_patch.txt, SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Commented: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Jeff Barrett (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=comments#action_12429459 ] 
            
Jeff Barrett commented on WSCOMMONS-74:
---------------------------------------

+1 to Rich's suggestion on preserving the existing behavior and changing the javadoc to clarify what that behavior is.

It seems important to preserve backwards compatability at this point, so the behavior of (localName, null) needs to be preserved.  The seperate Jira with an approach like (B) that continues to preserve backwards compatability while providing the ability to always create unqualified element seems like a good approach.

> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: axiom_api_patch.txt, axiom_impl_patch.txt, axiom_test_patch.txt, jaxsw_test_patch.txt, SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Commented: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Ruchith Udayanga Fernando (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=comments#action_12429622 ] 
            
Ruchith Udayanga Fernando commented on WSCOMMONS-74:
----------------------------------------------------

Ok ... now if serialize element created by fac.createOMElement("name", null); where the parent is a prefixed element then we have ambiguous behaviour:

Example: 

        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "ns1");
        OMElement personElem = fac.createOMElement("person", ns);

        OMElement nameElem = fac.createOMElement("name", null);
        nameElem.setText("John");
        personElem.addChild(nameElem);

        String xml = personElem.toString();
        System.out.println(xml);

The above produces the following:

<ns1:person xmlns:ns1="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name></ns1:person>

Now the "name" element is unqualified !!

Is this correct??


> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: axiom_api_patch.txt, axiom_impl_patch.txt, axiom_test_patch.txt, jaxsw_test_patch.txt, SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Commented: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Ruchith Udayanga Fernando (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=comments#action_12429412 ] 
            
Ruchith Udayanga Fernando commented on WSCOMMONS-74:
----------------------------------------------------

Hi Rich,

IF we create an element of the default namespace in the case where we do 

OMElement nameElem = fac.createOMElement("name", null); 

then how can I create an unqualified element where the parent has a default namespace declaration.

In other words how can generate the following XML:

<person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person> 

Thanks,
Ruchith

> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Resolved: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=all ]

Rich Scheuerle resolved WSCOMMONS-74.
-------------------------------------

    Resolution: Fixed

Fixed in SVN

> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: axiom_api_patch.txt, axiom_impl_patch.txt, axiom_test_patch.txt, jaxsw_test_patch.txt, SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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


[jira] Commented: (WSCOMMONS-74) Incorrect namespace serialization

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/WSCOMMONS-74?page=comments#action_12429407 ] 
            
Rich Scheuerle commented on WSCOMMONS-74:
-----------------------------------------

I have an untested fix for the first test.

The second test is actually wrong.   According to the code, the following will create an element that uses the default namespace. 
OMElement nameElem = fac.createOMElement("name", null); 

I am adding a few more tests to Ruchith's test to cover this case and the case of an actual unqualified element.



> Incorrect namespace serialization
> ---------------------------------
>
>                 Key: WSCOMMONS-74
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-74
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Ruchith Udayanga Fernando
>         Assigned To: Rich Scheuerle
>            Priority: Blocker
>         Attachments: SerializationTest.java
>
>
> Hi All,
> I noticed that axiom doesn't serialize namespaces correctly. 
> 1.) Namespaces in qualified elements
> For example we should be able to produce the following xml with the code that follows:
> <person1 xmlns="http://ws.apache.org/axis2/apacheconasia/06">
>   <name>John</name>
>   <name>John12</name>
>   <age>34</age>
> </person1>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         OMElement nameElem = fac.createOMElement("name", ns);
>         nameElem.setText("John");
>         
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         
>         
>         //Add children to the person element
>         personElem.addChild(nameElem);
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         
>         String xml = personElem.toString();
> But right now this produces the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="http://ws.apache.org/axis2/apacheconasia/06">John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> The repetition of the default namespace should be avoided.
> This is the same even if we used a prefixed namespace.
> 2.) Unqualified elements among qualified elements
>         
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace ns = fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
>         OMElement personElem = fac.createOMElement("person", ns);
>         //Create and add an unqualified element
>         OMElement nameElem = fac.createOMElement("name", null);
>         nameElem.setText("John");
>         personElem.addChild(nameElem);
>         OMElement ageElem = fac.createOMElement("age", ns);
>         ageElem.setText("34");
>         
>         OMElement weightElem = fac.createOMElement("weight", ns);
>         weightElem.setText("50");
>         personElem.addChild(ageElem);
>         personElem.addChild(weightElem);
>         System.out.println(personElem);
> The above should produce the following :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name xmlns="">John</name><age>34</age><weight>50</weight></person>
> But AXIOM right now produces :
> <person xmlns="http://ws.apache.org/axis2/apacheconasia/06"><name>John</name><age xmlns="http://ws.apache.org/axis2/apacheconasia/06">34</age><weight xmlns="http://ws.apache.org/axis2/apacheconasia/06">50</weight></person>
> What do u folks think?
> Thanks,
> Ruchith
> p.s. Added a test case

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