Package org.w3c.dom

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


      element.appendChild(text);
    }

    for (int i=0; i<this.attributeNames.length; i++) {

      Attr attr = document.createAttribute(this.attributeNames[i]);
      attr.setNodeValue(this.attributeValues[i]);
      element.setAttributeNode(attr);
    }

    // insert element into XRD
View Full Code Here


      element.appendChild(text);
    }

    for (int i=0; i<this.attributeNames.length; i++) {

      Attr attr = document.createAttribute(this.attributeNames[i]);
      attr.setNodeValue(this.attributeValues[i]);
      element.setAttributeNode(attr);
    }

    // insert element into XRD
View Full Code Here

        Element child = doc.createElement(childElem);
        Element xmlElem = doc.createElement(xmltextElem);
        Element encoded = doc.createElement(encodedElemName);
        Element grandchild = doc.createElement(grandChildElem);

        Attr attr = doc.createAttribute(attributeName);
        attr.setValue(attributeValue);
        Attr encodedAttr = doc.createAttribute(encodedAttributeName);
        encodedAttr.setValue(encodedAttributeValue);

        child.appendChild(encoded);
View Full Code Here

        Element encoded = doc.createElement(encodedElemName);
        Element grandchild = doc.createElement(grandChildElem);

        Attr attr = doc.createAttribute(attributeName);
        attr.setValue(attributeValue);
        Attr encodedAttr = doc.createAttribute(encodedAttributeName);
        encodedAttr.setValue(encodedAttributeValue);

        child.appendChild(encoded);
        child.setAttributeNode(encodedAttr);
View Full Code Here

    public static void putAt(Element self, String property, Object value) {
        if (property.startsWith("@")) {
            String attributeName = property.substring(1);
            Document doc = self.getOwnerDocument();
            Attr newAttr = doc.createAttribute(attributeName);
            newAttr.setValue(value.toString());
            self.setAttributeNode(newAttr);
            return;
        }
        InvokerHelper.setProperty(self, property, value);
View Full Code Here

      if (attr != null) {
        ((IDOMNode) attr).setValueSource(value);
      }
      else {
        Document document = element.getOwnerDocument();
        attr = document.createAttribute(STYLE);
        ((IDOMNode) attr).setValueSource(value);
        element.setAttributeNode(attr);
      }
    }
    this.ignoreNotification = false;
View Full Code Here

    // new attribute
    Document doc = getOwnerDocument();
    if (doc == null)
      return;
    attr = doc.createAttribute(name);
    if (attr == null)
      return;
    attr.setValue(value);
    appendAttributeNode(attr);
  }
View Full Code Here

      if (attr != null) {
        ((IDOMNode) attr).setValueSource(value);
      }
      else {
        Document document = element.getOwnerDocument();
        attr = document.createAttribute(_styleAttrName);
        ((IDOMNode) attr).setValueSource(value);
        element.setAttributeNode(attr);
      }
    }
    this.ignoreNotification = false;
View Full Code Here

      nsInfo.normalize();
              
      if (nsInfo.uri != null)
      {           
        String attrName = nsInfo.prefix != null ? "xmlns:" + nsInfo.prefix : "xmlns"; //$NON-NLS-1$ //$NON-NLS-2$
        Attr namespaceAttr = document.createAttribute(attrName)
        namespaceAttr.setValue(nsInfo.uri);
        element.setAttributeNode(namespaceAttr);  

        // in this case we use the attribute "xsi:schemaLocation"
        // here we build up its value
View Full Code Here

      }    
      else if (nsInfo.locationHint != null)
      {
        // in this case we use the attribute "xsi:noNamespaceSchemaLocation"
        //
        Attr attr = document.createAttribute("xsi:noNamespaceSchemaLocation");   //$NON-NLS-1$
        attr.setValue(nsInfo.locationHint);
        element.setAttributeNode(attr);
      }
    }
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.