Examples of createAttributeNS()


Examples of org.w3c.dom.Document.createAttributeNS()

            uri = "#" + uri;
        }
       
        Document doc = DOMUtils.createDocument();
        Element el = doc.createElementNS(ns, "wsp:" + Constants.ELEM_POLICY_REF);
        Attr att = doc.createAttributeNS(null, "URI");
        att.setValue(uri);
        el.setAttributeNodeNS(att);
        return el;
    }
View Full Code Here

Examples of org.w3c.dom.Document.createAttributeNS()

        try {
            reader = StaxUtils.createXMLStreamReader(src);
            Document doc = StaxUtils.read(reader);
            uri = getPolicyId(doc.getDocumentElement());
            if (StringUtils.isEmpty(uri)) {
                Attr att = doc.createAttributeNS(PolicyConstants.WSU_NAMESPACE_URI,
                                                 "wsu:" + PolicyConstants.WSU_ID_ATTR_NAME);
                att.setNodeValue(defName);
                doc.getDocumentElement().setAttributeNodeNS(att);
            }
           
View Full Code Here

Examples of org.w3c.dom.Document.createAttributeNS()

        }

        // root element has no namespace and local name "value"
        Element root = document.createElementNS(null, "value");
        if (type != null) {
            org.w3c.dom.Attr xsi = document.createAttributeNS(XMLNS_ATTRIBUTE_NS_URI, "xmlns:xsi");
            xsi.setValue(W3C_XML_SCHEMA_INSTANCE_NS_URI);
            root.setAttributeNodeNS(xsi);

            String prefix = type.getPrefix();
            if (prefix == null || prefix.length() == 0) {
View Full Code Here

Examples of org.w3c.dom.Document.createAttributeNS()

                prefix = "ns";
            }

            declareNamespace(root, prefix, type.getNamespaceURI());

            org.w3c.dom.Attr xsiType = document.createAttributeNS(W3C_XML_SCHEMA_INSTANCE_NS_URI, "xsi:type");
            xsiType.setValue(prefix + ":" + type.getLocalPart());
            root.setAttributeNodeNS(xsiType);
        }
        document.appendChild(root);
View Full Code Here

Examples of org.w3c.dom.Document.createAttributeNS()

        Document doc = domFactory.newDocumentBuilder().newDocument();

        // root element has no namespace and local name "value"
        Element root = doc.createElementNS(null, "value");
        if (type != null) {
            org.w3c.dom.Attr xsi = doc.createAttributeNS(XMLNS_ATTRIBUTE_NS_URI, "xmlns:xsi");
             xsi.setValue(W3C_XML_SCHEMA_INSTANCE_NS_URI);
            root.setAttributeNodeNS(xsi);

            String prefix = type.getPrefix();
            if (prefix == null || prefix.length() == 0) {
View Full Code Here

Examples of org.w3c.dom.Document.createAttributeNS()

                prefix = "ns";
            }

            declareNamespace(root, prefix, type.getNamespaceURI());

            org.w3c.dom.Attr xsiType = doc.createAttributeNS(W3C_XML_SCHEMA_INSTANCE_NS_URI, "xsi:type");
            xsiType.setValue(prefix + ":" + type.getLocalPart());
            root.setAttributeNodeNS(xsiType);
        }
        doc.appendChild(root);
View Full Code Here

Examples of org.w3c.dom.Document.createAttributeNS()

        if (nameAttr != null) {
            root.setAttributeNS(SCA11_NS, "sca:" + NAME, nameAttr);
        }
        declareNamespace(root, "sca", SCA11_NS);
        if (type != null) {
            org.w3c.dom.Attr xsi = document.createAttributeNS(XMLNS_ATTRIBUTE_NS_URI, "xmlns:xsi");
            xsi.setValue(W3C_XML_SCHEMA_INSTANCE_NS_URI);
            root.setAttributeNodeNS(xsi);

            String prefix = type.getPrefix();
            if (prefix == null || prefix.length() == 0) {
View Full Code Here

Examples of org.w3c.dom.Document.createAttributeNS()

                prefix = "ns";
            }

            declareNamespace(root, prefix, type.getNamespaceURI());

            org.w3c.dom.Attr xsiType = document.createAttributeNS(W3C_XML_SCHEMA_INSTANCE_NS_URI, "xsi:type");
            xsiType.setValue(prefix + ":" + type.getLocalPart());
            root.setAttributeNodeNS(xsiType);
        }
        document.appendChild(root);
View Full Code Here

Examples of org.w3c.dom.Document.createAttributeNS()

        Element e = doc.createElementNS("urn:test", "root");
        e.setAttribute("xmlns", "urn:test");
        doc.appendChild(e);
        e.setAttribute("att1", "value1");

        Attr attr = doc.createAttributeNS("urn:test2", "att2");
        attr.setValue("value2");
        attr.setPrefix("p");

        e.setAttribute("xmlns:p", "urn:test2");
View Full Code Here

Examples of org.w3c.dom.Document.createAttributeNS()

            Element hdr = doc.createElementNS(version.getHeader().getNamespaceURI(),
                    version.getHeader().getLocalPart());
            // add WSRM namespace declaration to header, instead of
            // repeating in each individual child node
           
            Attr attr = doc.createAttributeNS("http://www.w3.org/2000/xmlns/",
                                   "xmlns:" + RMConstants.getNamespacePrefix());
            attr.setValue(RMConstants.getNamespace());
            hdr.setAttributeNodeNS(attr);

            Marshaller marshaller = getJAXBContext().createMarshaller();
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.