Package org.w3c.dom

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


        } else if (source instanceof String) {
            DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
            Document doc = builder.newDocument();
            //quirky: create a temporary element, use its nodelist
            Element temp = doc.createElementNS(null, "temp");
            temp.appendChild(doc.createTextNode((String) source));
            nl = temp.getChildNodes();
        } else if (source == null) {
            // don't throw errors yet ?
            throw new RuntimeException("Source value was null for source " + sourceExpr);
        }
View Full Code Here


//            Document doc = new DocumentImpl();
        Element root = doc.createElement("ServiceExceptionReport");
        root.setAttribute("version", "1.1.0");
        Element ex = doc.createElement("ServiceException");
        ex.appendChild(doc.createTextNode(Message));
        if (Code != null)
            ex.setAttribute("code", Code);

        root.appendChild(ex);
        doc.appendChild(root);
View Full Code Here

    {
        Document doc = getDocument();
        Element e = doc.createElementNS( "urn:test","root");
        e.setAttribute("xmlns", "urn:test");
        doc.appendChild(e);
        Node text = doc.createTextNode("Hello World");
        e.appendChild(text);
       
        DOMUtils.writeXml(doc,System.out);
       
        W3CDOMStreamReader reader = new W3CDOMStreamReader(e);
View Full Code Here

            case IDX_BOOL :
              type = "bool";
              break;
          }
          propertyNode.setAttribute("type", type);
          propertyNode.appendChild(document.createTextNode((String) dataModel.getValue("value")));
          Object value = PropertyFactory.getInstance().constructProperty(propertyNode);
          PropertyTableRow row = new PropertyTableRow(userObject, value, propertyNode);
          userObject.widget.setProperty(name, value);
          WidgetTree.revalidate(userObject.widget);
View Full Code Here

    borderNode.setAttribute("border", type);
    Document document = borderNode.getOwnerDocument();

    if (type.equals("empty")) {
      Element top = document.createElement("top");
      top.appendChild(document.createTextNode((String) dataModel.getValue("empty_top")));
      borderNode.appendChild(top);

      Element bottom = document.createElement("bottom");
      bottom.appendChild(document.createTextNode((String) dataModel.getValue("empty_bottom")));
      borderNode.appendChild(bottom);
View Full Code Here

      Element top = document.createElement("top");
      top.appendChild(document.createTextNode((String) dataModel.getValue("empty_top")));
      borderNode.appendChild(top);

      Element bottom = document.createElement("bottom");
      bottom.appendChild(document.createTextNode((String) dataModel.getValue("empty_bottom")));
      borderNode.appendChild(bottom);

      Element left = document.createElement("left");
      left.appendChild(document.createTextNode((String) dataModel.getValue("empty_left")));
      borderNode.appendChild(left);
View Full Code Here

      Element bottom = document.createElement("bottom");
      bottom.appendChild(document.createTextNode((String) dataModel.getValue("empty_bottom")));
      borderNode.appendChild(bottom);

      Element left = document.createElement("left");
      left.appendChild(document.createTextNode((String) dataModel.getValue("empty_left")));
      borderNode.appendChild(left);

      Element right = document.createElement("right");
      right.appendChild(document.createTextNode((String) dataModel.getValue("empty_right")));
      borderNode.appendChild(right);
View Full Code Here

      Element left = document.createElement("left");
      left.appendChild(document.createTextNode((String) dataModel.getValue("empty_left")));
      borderNode.appendChild(left);

      Element right = document.createElement("right");
      right.appendChild(document.createTextNode((String) dataModel.getValue("empty_right")));
      borderNode.appendChild(right);
    } else if (type.equals("titled")) {
      Element title = document.createElement("title");
      title.appendChild(document.createTextNode((String) dataModel.getValue("titled_title")));
      borderNode.appendChild(title);
View Full Code Here

      Element right = document.createElement("right");
      right.appendChild(document.createTextNode((String) dataModel.getValue("empty_right")));
      borderNode.appendChild(right);
    } else if (type.equals("titled")) {
      Element title = document.createElement("title");
      title.appendChild(document.createTextNode((String) dataModel.getValue("titled_title")));
      borderNode.appendChild(title);
    }

    PropertyTableRow row = (PropertyTableRow) editorModel.getValue("row");
    WidgetUserObject object = row.getUserObject();
View Full Code Here

      Element widthNode = document.createElement("width");
      Element heightNode = document.createElement("height");
      propertyNode.appendChild(widthNode);
      propertyNode.appendChild(heightNode);
      widthNode.appendChild(document.createTextNode(String.valueOf((int) dimension.getWidth())));
      heightNode.appendChild(document.createTextNode(String.valueOf((int) dimension.getHeight())));
    } else {
      Point point = (Point) value;

      Element xNode = document.createElement("x");
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.