Package org.apache.axiom.om

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


    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        OMElement element = factory.createOMElement("test", null);
        OMAttribute attr1 = element.addAttribute("attr1", "value1", null);
        OMAttribute attr2 = element.addAttribute("attr2", "value2", null);
        element.removeAttribute(attr1);
        assertNull(attr1.getOwner());
        Iterator it = element.getAllAttributes();
        assertTrue(it.hasNext());
        assertSame(attr2, it.next());
        assertFalse(it.hasNext());
View Full Code Here


            ExactlyOne exactlyOne = new ExactlyOne();

            All all = new All();
            OMElement omElement = element.cloneOMElement();

            omElement.removeAttribute(omElement
                    .getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR));
            all.addPolicyComponent(new XmlPrimtiveAssertion(omElement));
            exactlyOne.addPolicyComponent(all);

            exactlyOne.addPolicyComponent(new All());
View Full Code Here

            ExactlyOne exactlyOne = new ExactlyOne();

            All all = new All();
            OMElement omElement = element.cloneOMElement();

            omElement.removeAttribute(omElement
                    .getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR));
            all.addPolicyComponent(new XmlPrimtiveAssertion(omElement));
            exactlyOne.addPolicyComponent(all);

            exactlyOne.addPolicyComponent(new All());
View Full Code Here

        return printer.xmlFormat();
    }

    public static OMElement parseAnonSequenceToOM(SequenceMediator seqMediator) {
        OMElement elem = seqMediator.serialize(null);
        elem.removeAttribute(elem.getAttribute(new QName("name")));
        return elem;
    }

    public static String parseAnonSequenceToString(SequenceMediator seqMediator,
                                                   String targetSeqName) {
View Full Code Here

                AttachmentPart ap = ((AttachmentPart)attachments.get(contentID.trim()));
                //update the key status as accessed
                keyAccessStatus.put(contentID.trim(), "accessed");
                OMText text = new OMTextImpl(ap.getDataHandler(), true,
                                             omEnvelope.getOMFactory());
                child.removeAttribute(hrefAttr);
                child.addChild(text);
            } else {
                //possibly there can be references in the children of this omEnvelope
                //so recurse through.
                insertAttachmentNodes(attachments, child, keyAccessStatus);
View Full Code Here

                AttachmentPart ap = ((AttachmentPart)attachments.get(contentID.trim()));
                //update the key status as accessed
                keyAccessStatus.put(contentID.trim(), "accessed");
                OMText text = new OMTextImpl(ap.getDataHandler(), true,
                                             omEnvelope.getOMFactory());
                child.removeAttribute(hrefAttr);
                child.addChild(text);
            } else {
                //possibly there can be references in the children of this omEnvelope
                //so recurse through.
                insertAttachmentNodes(attachments, child, keyAccessStatus);
View Full Code Here

                AttachmentPart ap = ((AttachmentPart)attachments.get(contentID.trim()));
                //update the key status as accessed
                keyAccessStatus.put(contentID.trim(), "accessed");
                OMText text = new OMTextImpl(ap.getDataHandler(), true,
                                             omEnvelope.getOMFactory());
                child.removeAttribute(hrefAttr);
                child.addChild(text);
            } else {
                //possibly there can be references in the children of this omEnvelope
                //so recurse through.
                insertAttachmentNodes(attachments, child, keyAccessStatus);
View Full Code Here

        OMElement element = factory.createOMElement("test", null);
        Document ownerDocument = ((Element)element).getOwnerDocument();
        assertNotNull(ownerDocument);
        OMAttribute attr = element.addAttribute("attr", "value", null);
        assertSame(ownerDocument, ((Attr)attr).getOwnerDocument());
        element.removeAttribute(attr);
        Document newOwnerDocument = ((Attr)attr).getOwnerDocument();
        assertNotNull(ownerDocument);
        assertNotSame(ownerDocument, newOwnerDocument);
    }
}
View Full Code Here

            if (contentID != null) {//This is an omEnvelope referencing an attachment
                child.build();
                AttachmentPart ap = ((AttachmentPart) attachments.get(contentID.trim()));
                OMText text = new OMTextImpl(ap.getDataHandler(), true,
                        omEnvelope.getOMFactory());
                child.removeAttribute(hrefAttr);
                child.addChild(text);
            } else {

                //possibly there can be references in the children of this omEnvelope
                //so recurse through.
View Full Code Here

            ExactlyOne exactlyOne = new ExactlyOne();

            All all = new All();
            OMElement omElement = element.cloneOMElement();

            omElement.removeAttribute(omElement
                    .getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR));
            all.addPolicyComponent(new XmlPrimtiveAssertion(omElement));
            exactlyOne.addPolicyComponent(all);

            exactlyOne.addPolicyComponent(new All());
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.