use of org.apache.axiom.om.OMXMLParserWrapper in project webservices-axiom by apache.
the class OMAttributeTest method addAttributeMethod1.
private String addAttributeMethod1(String xmlString) throws Exception {
OMXMLParserWrapper builder2 = OMXMLBuilderFactory.createOMBuilder(new StringReader(xmlString));
OMElement doc = builder2.getDocumentElement();
OMFactory factory = OMAbstractFactory.getOMFactory();
OMNamespace ns = factory.createOMNamespace("http://www.me.com", "axiom");
//code line to be tested
OMAttribute at = factory.createOMAttribute("id", ns, "value");
doc.addAttribute(at);
return doc.toString();
}
use of org.apache.axiom.om.OMXMLParserWrapper in project webservices-axiom by apache.
the class PreserveEnvelopeTest method testOMNS.
public void testOMNS() {
OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(new StringReader(originalXML));
OMElement documentElement = builder.getDocumentElement();
//assertXMLEqual(originalXML, documentElement.toString());
documentElement.build();
String outstr = documentElement.toString();
assertTrue(outstr.indexOf("xmlns:saml=") > 0);
assertTrue(outstr.indexOf("<Assertion") == 0);
}
Aggregations