Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMElement.declareNamespace()


                        String qname = reader.getAttributeLocalName(i);
                        String value = reader.getAttributeValue(i);
                       
                        if (ns != null) {
                            child.addAttribute(qname, value, fac.createOMNamespace(ns, prefix));
                            child.declareNamespace(ns, prefix);
                        } else {
                            child.addAttribute(qname, value, null);
                        }
                    }
                    current = child;
View Full Code Here


            logger.fatal((new StringBuilder()).append("Exception thrown while storing message: ").append(message).append("in msgbx: ").append(clientid).toString(), e);
            status.setText("false");
        }
        OMElement resp = factory.createOMElement(ProcessingContext.STOREMSG_RESP_QNAME);
        resp.addChild(status);
        resp.declareNamespace(MsgBoxNameSpConsts.MSG_BOX);
        return resp;
    }

    public OMElement takeMessages(ProcessingContext procCtxt)
        throws Exception
View Full Code Here

    private OMElement getSampleDocumentElement(OMNamespace testNamespace){
        OMFactory factory = OMAbstractFactory.getOMFactory();

        OMElement documentElement = factory.createOMElement("Employees", testNamespace);
        documentElement.declareNamespace(testNamespace);

        OMElement employee;
        OMElement name;

        for (int i = 0; i < 5; i++) {
View Full Code Here

    public void testDualNamespaces2() throws Exception {
        OMFactory factory = OMAbstractFactory.getOMFactory();
        OMNamespace ns1 = factory.createOMNamespace("bar", "x");
        OMElement root = factory.createOMElement("root", ns1);
        OMNamespace ns2 = root.declareNamespace("bar", "y");
        OMElement elt1 = factory.createOMElement("foo", ns1);
        OMElement elt2 = factory.createOMElement("yuck", ns2);
        OMText txt1 = factory.createOMText(elt2, "blah");
        elt2.addChild(txt1);
        elt1.addChild(elt2);
View Full Code Here

        String NSURI_UPPER = "HTTP://TESTNS";

        OMFactory fac = new OMDOMFactory();
        OMNamespace ns = new NamespaceImpl(NSURI);
        OMElement el = fac.createOMElement("foo", null);
        el.declareNamespace(NSURI, "p");
        assertNull(el.findNamespace(NSURI_UPPER, "p"));
    }
}
View Full Code Here

            // Get the OMNode inside the RubyObjecting object
            if (RubyObject instanceof RubyString) {
                element.setText((String) RubyObject);
                if (addTypeInfo) {
                    element.declareNamespace(xsNamespace);
                    element.addAttribute("type", "xs:string", xsiNamespace);
                }
            } else if (RubyObject instanceof RubyBignum) {
                element.setText(RubyObject.toString());
                if (addTypeInfo) {
View Full Code Here

                    element.addAttribute("type", "xs:string", xsiNamespace);
                }
            } else if (RubyObject instanceof RubyBignum) {
                element.setText(RubyObject.toString());
                if (addTypeInfo) {
                    element.declareNamespace(xsNamespace);
                    element.addAttribute("type", "xs:integer", xsiNamespace);
                }
            } else if (RubyObject instanceof RubyFloat) {
                element.setText(RubyObject.toString());
                if (addTypeInfo) {
View Full Code Here

                    element.addAttribute("type", "xs:integer", xsiNamespace);
                }
            } else if (RubyObject instanceof RubyFloat) {
                element.setText(RubyObject.toString());
                if (addTypeInfo) {
                    element.declareNamespace(xsNamespace);
                    element.addAttribute("type", "xs:float", xsiNamespace);
                }
            } else if (RubyObject instanceof RubyInteger) {
                element.setText(RubyObject.toString());
                if (addTypeInfo) {
View Full Code Here

                    element.addAttribute("type", "xs:float", xsiNamespace);
                }
            } else if (RubyObject instanceof RubyInteger) {
                element.setText(RubyObject.toString());
                if (addTypeInfo) {
                    element.declareNamespace(xsNamespace);
                    element.addAttribute("type", "xs:long", xsiNamespace);
                }
            } else if (RubyObject instanceof RubyArray) {
                String strXml = "<List>";
                String st[];
View Full Code Here

                strXml = strXml + "</List>";
                strXml = strXml.replaceAll("'", "");
                strXml = strXml.replaceAll(" ", "");
                element.setText(strXml);
                if (addTypeInfo) {
                    element.declareNamespace(xsNamespace);
                    element.addAttribute("type", "xs:anyType", xsiNamespace);
                }
            }
            return element;
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.