Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMContainer


                    if (prefix.length() != 0 && seenPrefixes.add(prefix)) {
                        addNamespace(ns.getPrefix(), ns.getNamespaceURI());
                    }
                }
            }
            OMContainer parent = current.getParent();
            if (parent == null || parent instanceof OMDocument) {
                break;
            } else {
                current = (OMElement)parent;
            }
View Full Code Here


        String elementName = parser.getLocalName();
        if (lastNode == null) {
            node = constructNode(null, elementName, true);
            setSOAPEnvelope(node);
        } else if (lastNode.isComplete()) {
            OMContainer parent = lastNode.getParent();
            if (parent == document) {
                // If we get here, this means that we found the SOAP envelope, but that it was
                // preceded by a comment node. Since constructNode will create a new document
                // based on the SOAP version of the envelope, we simply discard the last node
                // and do as if we just encountered the first node in the document.
View Full Code Here

       
        if (log.isDebugEnabled()) {
            log.debug("Invoking CustomBuilder, " + customBuilder.toString() +
                      ", to the OMNode for {" + namespace + "}" + localPart);
        }
        OMContainer parent = null;
        if (lastNode != null) {
            if (lastNode.isComplete()) {
                parent = lastNode.getParent();
            } else {
                parent = (OMContainer)lastNode;
View Full Code Here

     *      java.lang.String, java.lang.String)
     */
    public void endElement(String arg0, String arg1, String arg2)
            throws SAXException {
        if (lastNode.isComplete()) {
            OMContainer parent = lastNode.getParent();
            ((OMNodeEx) parent).setComplete(true);
            lastNode = (OMNode) parent;
        } else {
            OMElement e = (OMElement) lastNode;
            ((OMNodeEx) e).setComplete(true);
View Full Code Here

            String value = StringFunction.evaluate(o, navigator);
            IRI resolved = null;
            IRI baseUri = null;
            if (o instanceof OMNode) {
              OMNode node = (OMNode) o;
              OMContainer el = node.getParent();
              if (el instanceof Document) {
                Document<Element> doc = (Document<Element>) el;
                baseUri = doc.getBaseUri();
              } else if (el instanceof Element) {
                Element element = (Element) el;
View Full Code Here

        String prefix = ns.getPrefix();
        String uri = ns.getNamespaceURI();
        if (!namespaces.containsKey(prefix))
          namespaces.put(prefix, uri);
      }
      OMContainer parent = current.getParent();
      current = (OMElement) ((parent != null && parent instanceof OMElement) ? parent : null);
    }
    return Collections.unmodifiableMap(namespaces);
  }
View Full Code Here

        // invoke transformation, with static enveope
        MessageContext synCtx = TestUtils.getTestContextForXSLTMediator(SOURCE, props);
        transformMediator.mediate(synCtx);

        // validate result
        OMContainer body = synCtx.getEnvelope().getBody();
        if (body.getFirstOMChild().getNextOMSibling() instanceof OMElement) {

            OMElement getQuoteElem = (OMElement) body.getFirstOMChild().getNextOMSibling();
            assertTrue("GetQuote".equals(getQuoteElem.getLocalName()));
            assertTrue("http://www.webserviceX.NET/".equals(getQuoteElem.getNamespace().getNamespaceURI()));

            OMElement symbolElem = getQuoteElem.getFirstElement();
            assertTrue("symbol".equals(symbolElem.getLocalName()));
View Full Code Here

        // invoke transformation, with static enveope
        MessageContext synCtx = TestUtils.getTestContextForXSLTMediator(SOURCE, props);
        transformMediator.mediate(synCtx);

        // validate result
        OMContainer body = synCtx.getEnvelope().getBody();
        if (body.getFirstOMChild().getNextOMSibling() instanceof OMElement) {

            OMElement getQuoteElem = (OMElement) body.getFirstOMChild().getNextOMSibling();
            assertTrue("GetQuote".equals(getQuoteElem.getLocalName()));
            assertTrue("http://www.webserviceX.NET/".equals(getQuoteElem.getNamespace().getNamespaceURI()));

            OMElement symbolElem = getQuoteElem.getFirstElement();
            assertTrue("symbol".equals(symbolElem.getLocalName()));
View Full Code Here

        // invoke transformation, with static enveope
        MessageContext synCtx = TestUtils.getTestContextForXSLTMediator(ENCLOSING_SOURCE, props);
        transformMediator.mediate(synCtx);

        // validate result
        OMContainer body = synCtx.getEnvelope().getBody();
        if (body.getFirstOMChild().getNextOMSibling() instanceof OMElement) {

            OMElement someOtherElem = (OMElement) body.getFirstOMChild().getNextOMSibling();
            assertTrue("someOtherElement".equals(someOtherElem.getLocalName()));
            assertTrue("http://someother".equals(someOtherElem.getNamespace().getNamespaceURI()));

            OMElement getQuoteElem = (OMElement) someOtherElem.getFirstOMChild();
            assertTrue("GetQuote".equals(getQuoteElem.getLocalName()));
View Full Code Here

                backtracked = true;
            } else {
                next = null;
            }
        } else {
            OMContainer parent = next.getParent();
            OMNode nextSibling = getNextSibling(next);
            if (nextSibling != null) {
                next = nextSibling;
            } else if ((parent != null) && parent.isComplete() && !(parent instanceof OMDocument)) {
                next = (OMNodeImpl) parent;
                backtracked = true;
            } else {
                next = null;
            }
View Full Code Here

TOP

Related Classes of org.apache.axiom.om.OMContainer

Copyright © 2018 www.massapicom. 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.