Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMNode


           
            public boolean isDestructiveWrite() {
                return false;
            }
        });
        OMNode child = element.getFirstOMChild();
        assertTrue(child instanceof OMComment);
        assertEquals("comment", ((OMComment)child).getValue());
    }
View Full Code Here


        }

        String XPathString = "//elem1";

        AXIOMXPath XPath = new AXIOMXPath(XPathString);
        OMNode node = (OMNode) XPath.selectSingleNode(envelope);

        assertNotNull(node);
    }
View Full Code Here

        // Set an empty MustUnderstand property on the data source
        bads1.setProperty(SOAPHeaderBlock.MUST_UNDERSTAND_PROPERTY, null);
       
        OMSourcedElement omse = soapFactory.createSOAPHeaderBlock(localName, ns, bads1);
        soapHeader.addChild(omse);
        OMNode firstChild = soapHeader.getFirstOMChild();
        assertTrue("Expected OMSourcedElement child", firstChild instanceof SOAPHeaderBlock);
        SOAPHeaderBlock child = (SOAPHeaderBlock) firstChild;
        assertTrue("OMSourcedElement is expanded.  This is unexpected", !child.isExpanded());
        assertTrue("OMSourcedElement should be backed by a ByteArrayDataSource",
                   child.getDataSource() instanceof ByteArrayDataSource);
View Full Code Here

    }

    public void testElementSerilizationChild() throws Exception {
        OMElement elt = builder.getDocumentElement();
        OMNode node = elt.getFirstOMChild().getNextOMSibling();
        node.serialize(writer);

    }
View Full Code Here

    }

    public void testElementSerilizationSOAPBodyCacheOff() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
        OMNode node = env.getBody();
        node.serialize(writer);
    }
View Full Code Here

        OMXMLParserWrapper omBuilder = OMXMLBuilderFactory.createSOAPModelBuilder(
                getTestResource(TestConstants.WHITESPACE_MESSAGE), null);
        OMElement envelope = omBuilder.getDocumentElement();
       
        // The body is the second element
        OMNode node = envelope.getFirstElement();
        node = node.getNextOMSibling();
        while (node != null && !(node instanceof OMElement)) {
            node = node.getNextOMSibling();
        }
        OMElement body = (OMElement) node;
       
        // Try the QName version
        QName qname = new QName(nsUri, "local", nsPrefix);
View Full Code Here

    public SOAPEnvelope getSOAPEnvelope() throws OMException {
        return (SOAPEnvelope)getDocumentElement();
    }

    protected OMNode createNextOMElement() {
        OMNode newElement = null;
       
       
        if (elementLevel == 3 &&
            customBuilderForPayload != null) {
           
View Full Code Here

        OMElement child = element.getFirstElement();
        assertEquals("Child element name", "type", child.getLocalName());
        assertEquals("Child element namespace",
                     "http://www.sosnoski.com/uwjws/library",
                     child.getNamespace().getNamespaceURI());
        OMNode next = child.getNextOMSibling();
        assertTrue("Expected child element", next instanceof OMElement);
        next = next.getNextOMSibling();
        assertTrue("Expected child element", next instanceof OMElement);
        child = (OMElement) next;
        assertEquals("Child element name", "book", child.getLocalName());
        assertEquals("Child element namespace",
                     "http://www.sosnoski.com/uwjws/library",
View Full Code Here

            dos.writeInt(9);
            Collection childNodes = getValidElements(document);
            dos.writeInt(childNodes.size());
            Iterator itr = childNodes.iterator();
            while (itr.hasNext()) {
                OMNode node = (OMNode) itr.next();
                if (node.getType() == OMNode.PI_NODE)
                    dos.write(getDigest((OMProcessingInstruction) node, digestAlgorithm));
                else if (
                        node.getType() == OMNode.ELEMENT_NODE)
                    dos.write(getDigest((OMElement) node, digestAlgorithm));
            }
            dos.close();
            md.update(baos.toByteArray());
            digest = md.digest();
View Full Code Here

            Collection attrs = getAttributesWithoutNS(element);
            dos.writeInt(attrs.size());
            Iterator itr = attrs.iterator();
            while (itr.hasNext())
                dos.write(getDigest((OMAttribute) itr.next(), digestAlgorithm));
            OMNode node = element.getFirstOMChild();
            // adjoining Texts are merged,
            // there is  no 0-length Text, and
            // comment nodes are removed.
            int length = 0;
            itr = element.getChildren();
            while (itr.hasNext()) {
                OMNode child = (OMNode)itr.next();
                if (child instanceof OMElement || child instanceof OMText || child instanceof OMProcessingInstruction) {
                    length++;
                }
            }
            dos.writeInt(length);
View Full Code Here

TOP

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

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.