Hi this is what i do for generating an xml code:
OMFactory factory = OMAbstractFactory.getOMFactory();
OMNamespace nsSequence = factory.createOMNamespace("http://ws.apache.org/ns/synapse", "");
OMElement rootSequence = factory.createOMElement("sequence",nsSequence);
/*<FILTER>*/
OMNamespace nsFilter = factory.createOMNamespace("http://org.apache.synapse/xsd", "ns");
OMElement filter = factory.createOMElement("filter",nsFilter);
OMAttribute regex = factory.createOMAttribute("regex", null, "applID");
OMAttribute source = factory.createOMAttribute("source", null, "get-property('applicationID')");
filter.addAttribute(regex);
filter.addAttribute(source);
/*<THEN>*/
OMElement then = factory.createOMElement("then",null);
filter.addChild(then);
rootSequence.addChild(filter);
the generated code is like this one:
<sequence xmlns="http://ws.apache.org/ns/synapse">
<ns:filter xmlns:ns="http://org.apache.synapse/xsd" regex="APPP" source="get-property('applicationID')">
<then xmlns=""></then>
</ns:filter>
</sequence>
The XMLNS="" inside the THEN element is a big problem for me.
i m using axiom-api 1.2.14... and i read somewhere this is a problem (bug) experienced by others (maybe already solver?). Is there a way to work around this problem in order to obtain a clean xml code? or better to solve it?