Package org.w3c.dom

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


          SSAFNodes.requested_start_offset.getNamespace(),
          SSAFNodes.requested_start_offset.getQName());
      startOffSetAttribute.setNodeValue(startOffset);
      presentationControlElement.setAttributeNode(startOffSetAttribute);

      Attr endOffSetAttribute = errorDocument.createAttributeNS(
          SSAFNodes.requested_end_offset.getNamespace(),
          SSAFNodes.requested_end_offset.getQName());
      endOffSetAttribute.setNodeValue(endOffset);
      presentationControlElement.setAttributeNode(endOffSetAttribute);
     
View Full Code Here


            SSAFNodes.record_retrieval_error_result.getNamespace(),
            SSAFNodes.record_retrieval_error_result.getQName());
        retrieveErrorDocument.appendChild(root);
       
        // add record_uri attribute to root element
        Attr errorTypeAttribute = retrieveErrorDocument
            .createAttributeNS(SSAFNodes.error_type.getNamespace(),
                SSAFNodes.error_type.getQName());
        errorTypeAttribute.setNodeValue(errorTypes.toString());
        root.setAttributeNode(errorTypeAttribute);
       
View Full Code Here

       
        // get record_uri from incoming RetrieveRequest Element
        String recordURI = incomingRetrieveRequestElement.getAttributeNS(
            SSAFNodes.record_uri.getNamespace(),  SSAFNodes.record_uri.getLocalName());

        Attr recordURIAttribute = retrieveErrorDocument
            .createAttributeNS(SSAFNodes.record_uri.getNamespace(),
                SSAFNodes.record_uri.getQName());
        recordURIAttribute.setNodeValue(recordURI);
        root.setAttributeNode(recordURIAttribute);
View Full Code Here

            String prefix = reader.getAttributePrefix(att);
            if (prefix != null && prefix.length() > 0) {
                name = prefix + ":" + name;
            }

            Attr attr = doc.createAttributeNS(reader.getAttributeNamespace(att), name);
            attr.setValue(reader.getAttributeValue(att));
            e.setAttributeNode(attr);
        }

        if (repairing && !isDeclared(e, reader.getNamespaceURI(), reader.getPrefix())) {
View Full Code Here

                   
                    uri = doc.getDocumentElement().getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI,
                                                                  PolicyConstants.WSU_ID_ATTR_NAME);
                    if (StringUtils.isEmpty(uri)) {
                        uri = defName;
                        Attr att = doc.createAttributeNS(PolicyConstants.WSU_NAMESPACE_URI,
                                                         "wsu:" + PolicyConstants.WSU_ID_ATTR_NAME);
                        att.setNodeValue(defName);
                        doc.getDocumentElement().setAttributeNodeNS(att);
                    }
                    ns = doc.getDocumentElement().getNamespaceURI();
View Full Code Here

            }
        }
        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

            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

                           hdr,
                           marshaller);
            Node node = hdr.getFirstChild();
            if (node instanceof Element) {
               
                Attr attr = doc.createAttributeNS("http://www.w3.org/2000/xmlns/",
                                                  "xmlns:" + RMConstants.getNamespacePrefix());
                attr.setValue(RMConstants.getNamespace());
                ((Element)node).setAttributeNodeNS(attr);
            }
           
View Full Code Here

    @Test
    public void testCXF2468() throws Exception {
        Document doc = XMLUtils.newDocument();
        doc.appendChild(doc.createElementNS("http://blah.org/", "blah"));
        Element foo = doc.createElementNS("http://blah.org/", "foo");
        Attr attr = doc.createAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:nil");
        attr.setValue("true");
        foo.setAttributeNodeNS(attr);
        doc.getDocumentElement().appendChild(foo);
        XMLStreamReader sreader = StaxUtils.createXMLStreamReader(doc);
        StringWriter sw = new StringWriter();
View Full Code Here

    @Test
    public void testCXF2468() throws Exception {
        Document doc = XMLUtils.newDocument();
        doc.appendChild(doc.createElementNS("http://blah.org/", "blah"));
        Element foo = doc.createElementNS("http://blah.org/", "foo");
        Attr attr = doc.createAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:nil");
        attr.setValue("true");
        foo.setAttributeNodeNS(attr);
        doc.getDocumentElement().appendChild(foo);
        XMLStreamReader sreader = StaxUtils.createXMLStreamReader(doc);
        StringWriter sw = new StringWriter();
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.