Package org.w3c.dom

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


            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


    else {

      // new attribute
      Document doc = getOwnerDocument();
      if (doc != null) {
        attr = doc.createAttributeNS(uri, qualifiedName);
        if (attr != null) {
          attr.setValue(value);
          appendAttributeNode(attr);
        }
      }
View Full Code Here

        }

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

                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

                    service.getDescription().addExtensor(uee);
                    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

    @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

          Element root = reponseDoc.createElementNS(SSAFNodes.report_responses
                  .getNamespace(), SSAFNodes.report_responses.getQName());
          reponseDoc.appendChild(root);
         
          // add all the attributes   to root element      
         Attr getConfirmationsAttribute = reponseDoc.createAttributeNS(SSAFNodes.get_confirmations
                  .getNamespace(), SSAFNodes.get_confirmations.getQName());
         getConfirmationsAttribute.setNodeValue(String.valueOf(getConfirmations));
         root.setAttributeNode(getConfirmationsAttribute);
         
         Attr  getErrorsAttribute = reponseDoc.createAttributeNS(SSAFNodes.get_errors
View Full Code Here

         Attr getConfirmationsAttribute = reponseDoc.createAttributeNS(SSAFNodes.get_confirmations
                  .getNamespace(), SSAFNodes.get_confirmations.getQName());
         getConfirmationsAttribute.setNodeValue(String.valueOf(getConfirmations));
         root.setAttributeNode(getConfirmationsAttribute);
         
         Attr  getErrorsAttribute = reponseDoc.createAttributeNS(SSAFNodes.get_errors
                  .getNamespace(), SSAFNodes.get_errors.getQName());
         getErrorsAttribute.setNodeValue(String.valueOf(getErrors));
         root.setAttributeNode(getErrorsAttribute);
         
         Attr  getCountsOnlysAttribute =  reponseDoc.createAttributeNS(SSAFNodes.counts_only
View Full Code Here

         Attr  getErrorsAttribute = reponseDoc.createAttributeNS(SSAFNodes.get_errors
                  .getNamespace(), SSAFNodes.get_errors.getQName());
         getErrorsAttribute.setNodeValue(String.valueOf(getErrors));
         root.setAttributeNode(getErrorsAttribute);
         
         Attr  getCountsOnlysAttribute =  reponseDoc.createAttributeNS(SSAFNodes.counts_only
                  .getNamespace(), SSAFNodes.counts_only.getQName());
         getCountsOnlysAttribute.setNodeValue(String.valueOf(countOnly));
         root.setAttributeNode(getCountsOnlysAttribute);
         
         Attr  getConfirmationCountAttribute = reponseDoc.createAttributeNS(SSAFNodes.confirmations_count
View Full Code Here

         Attr  getCountsOnlysAttribute =  reponseDoc.createAttributeNS(SSAFNodes.counts_only
                  .getNamespace(), SSAFNodes.counts_only.getQName());
         getCountsOnlysAttribute.setNodeValue(String.valueOf(countOnly));
         root.setAttributeNode(getCountsOnlysAttribute);
         
         Attr  getConfirmationCountAttribute = reponseDoc.createAttributeNS(SSAFNodes.confirmations_count
              .getNamespace(), SSAFNodes.confirmations_count.getQName());
         getConfirmationCountAttribute.setNodeValue(String.valueOf(confirmCount));
         root.setAttributeNode(getConfirmationCountAttribute);
         
         Attr  getErrorsCountAttribute =  reponseDoc.createAttributeNS(SSAFNodes.errors_count
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.