Examples of createAttributeNS()


Examples of org.apache.xerces.dom.DocumentImpl.createAttributeNS()

        Element rootEl = doc.getDocumentElement();

        //
        // Create a set of attributes and hang them on the root element.
        //
        Attr attra = doc.createAttributeNS("http://nsa", "a:attra")
        rootEl.setAttributeNodeNS(attra);
        Attr attrb = doc.createAttributeNS("http://nsb", "attrb");  
        rootEl.setAttributeNodeNS(attrb);
        Attr attrc = doc.createAttributeNS(null,           "attrc")
        rootEl.setAttributeNodeNS(attrc);
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()

            (namespace.contains("##local") ||
            namespace.contains(ns) || namespace.contains(nsAlt))) {
         
          Attr attr;
          if (qualify && !(ns.equals(ctx.getDefaultNS()) || ctx.getDefaultNS().equals(nsAlt))) {
            attr = doc.createAttributeNS(ns, p.getLocalName());
            attr.setPrefix(pref)
          }
          else attr = doc.createAttribute(p.getLocalName());
          attr.setNodeValue(s.getString());
          if (qualify) e.setAttributeNodeNS(attr);
View Full Code Here

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

      Document doc = e.getOwnerDocument();
      schema xs = (schema) this.get_owner();
      Attr a;
      if (isQualified()) {
        String ns = xs.getTargetNamespace();
        a = doc.createAttributeNS(ns, def.getName());
        //if (Character.isLetterOrDigit(ns.charAt(ns.length()-1))) ns += "#";
        a.setPrefix(ctx.getModel().getNsURIPrefix(ns));
        e.setAttributeNodeNS(a);
      }
      else e.setAttributeNode(a = doc.createAttribute(def.getName()));
View Full Code Here

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

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

    protected void runTest() throws Throwable {
        Document document = dbf.newDocumentBuilder().newDocument();
        Element element = document.createElementNS(null, "test");
       
        // Add the original attribute
        Attr attr = document.createAttributeNS("urn:test", "p1:attr");
        attr.setValue("value1");
        element.setAttributeNodeNS(attr);
       
        // Now change the attribute using setAttributeNS
        element.setAttributeNS("urn:test", "p2:attr", "value2");
View Full Code Here

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

        super(dbf);
    }

    protected void runTest() throws Throwable {
        Document document = dbf.newDocumentBuilder().newDocument();
        Attr attr = document.createAttributeNS(null, "attr");
        attr.appendChild(document.createTextNode("foo"));
        attr.appendChild(document.createTextNode("bar"));
        Element element = document.createElementNS(null, "test");
        element.setAttributeNodeNS(attr);
        Element clonedElement = (Element)element.cloneNode(false);
View Full Code Here

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

    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

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

                    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

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