Package org.w3c.dom

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


          else if (object instanceof XBoolean)
            element = lDoc.createElementNS(EXSL_URI, "exsl:boolean");
          else
            element = lDoc.createElementNS(EXSL_URI, "exsl:string");
         
          Text textNode = lDoc.createTextNode(object.str());
          element.appendChild(textNode);
          resultSet.addNode(element);
        }
      }
      catch (Exception e)
View Full Code Here


    */
   public static void addReturnToElement(Element e) {

      Document doc = e.getOwnerDocument();

      e.appendChild(doc.createTextNode("\n"));
   }

   /**
    * Method convertNodelistToSet
    *
 
View Full Code Here

      {
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document myDoc = db.newDocument();
       
        Text textNode = myDoc.createTextNode(textNodeValue);
        DocumentFragment docFrag = myDoc.createDocumentFragment();
 
        docFrag.appendChild(textNode);
 
        return new NodeSet(docFrag);
View Full Code Here

    synchronized (doc)
    {
      while (lTokenizer.hasMoreTokens())
      {
        resultSet.addNode(doc.createTextNode(lTokenizer.nextToken()));
      }
    }

    return resultSet;
  }
View Full Code Here

        // class not found ? (add error content if NotFound)
        classElement.setAttribute("classNotFound", Boolean.toString(classNotFound));
        if (classNotFound) {
            Element errorElement = document.createElement("error");
            classElement.appendChild(errorElement);
            Text errorText = document.createTextNode(error);
            errorElement.appendChild(errorText);
        } else {
            // Class found ! Add details (if any)

            // Search if the classes was loaded from the module, from the application or from the system
View Full Code Here

           // ClassLoader info (if any)
           if (classClassLoader != null) {
               Element classLoaderElement = document.createElement("class-loader");
               classElement.appendChild(classLoaderElement);
               classLoaderElement.setAttribute("name", classClassLoader.getClass().getName());
               Text classLoaderText = document.createTextNode(classClassLoader.toString());
               classLoaderElement.appendChild(classLoaderText);
            }
        }

        StringWriter stringWriter = new StringWriter();
View Full Code Here

      // Create config element
      Element config = doc.createElement(XMLAttributePersistenceManager.DATA_DIR_ELEMENT);
     
      // Insert a text node with the directory name
      Node text = doc.createTextNode(dir);
     
      config.appendChild(text);
     
      // Return the config
      return config;
View Full Code Here

          if (peditor != null) {
           // (c) use a PropertyEditor - mark the type and append the value as string              
             peditor.setValue(value);
            
             element.setAttribute(AL_TYPE_ATTRIBUTE, type);
             element.appendChild(doc.createTextNode(peditor.getAsText()));
            
             // append the attribute to the attribute-list
             root.appendChild(element);
          }
          else if (value instanceof Serializable) {
View Full Code Here

               String encoded = encodeAsHexString((Serializable)value);
              
               if (encoded != null) {
                  element.setAttribute(AL_TYPE_ATTRIBUTE, type);
                  element.setAttribute(AL_SERIALIZED_ATTRIBUTE, AL_TRUE_VALUE);
                  element.appendChild(doc.createTextNode(encoded));

                  // append the attribute to the attribute-list
                  root.appendChild(element);
               }
               else {
View Full Code Here

        Statement stmt = element.asStatement((Resource) ni.nextNode());
        if (stmt.getPredicate().equals(RDF.value)) {
          // add literal value
          RDFNode value = stmt.getObject();
          if (value.isLiteral())
            elem.appendChild(doc.createTextNode(value.toString()))
        }
        else {
          Element e = noSchemaToElement(elem,stmt.getPredicate(),ctx);
          if (e!=null) {
            elem.appendChild(e);
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.