[
https://issues.apache.org/jira/browse/WSCOMMONS-212?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andreas Veithen updated WSCOMMONS-212:
--------------------------------------
Fix Version/s: Axiom 1.3
Setting fix version to 1.3 since the requested enhancement implies a change in
Axiom's abstract APIs.
> 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
> Fix For: Axiom 1.3
>
>
> 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.