adding QName support to attribute values
----------------------------------------

                 Key: WSCOMMONS-212
                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-212
             Project: WS-Commons
          Issue Type: New Feature
          Components: AXIOM
            Reporter: Amila Chinthaka Suriarachchi
            Priority: Minor


Currently there is no direct API method to give an QName as an attribute value.
for an example lets say I have to create and OMElment for this xml string 
(programatically)

<ns1:inObject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:ns1="http://tempuri.org/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xsi:type="xsd:string">Test String</ns1:inObject>

I managed to do it in this way by declaring the namespace and set it as a 
normal attribute.

OMFactory omFactory = OMAbstractFactory.getOMFactory();
        OMNamespace omNamespace1 = 
omFactory.createOMNamespace("http://tempuri.org/","ns1";);
        OMNamespace omNamespace2 = 
omFactory.createOMNamespace("http://www.w3.org/2001/XMLSchema-instance","xsi";);
        OMNamespace omNamespace3 = 
omFactory.createOMNamespace("http://www.w3.org/2001/XMLSchema","xsd";);
        OMElement omElement = 
omFactory.createOMElement("inObject",omNamespace1);
        omElement.declareNamespace(omNamespace3);
        OMAttribute omatribute = 
omFactory.createOMAttribute("type",omNamespace2,"xsd:string");
        omElement.addAttribute(omatribute);
        omElement.setText("Test String");

but nice to have a method 
createOMAttribute(String,omNamespace,QName)

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to