Package org.w3c.dom

Examples of org.w3c.dom.Text


          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


        // 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
            String type = null;
            if (inEAR) {
                type = "Application / EJBs";
            } else {
                type = "Application/EJBJAR (This module)";
            }


            ClassLoader classClassLoader = clazz.getClassLoader();
            ClassLoader cl = ejbClassLoader;
            boolean found = false;
            while (cl != null && !found) {

                // ClassLoader is equals to the classloader that has loaded the class
                if (cl.equals(classClassLoader)) {
                    found = true;
                }

                cl = cl.getParent();
            }

            if (!found) {
                type = "System";
            }


            // Add where the class has been found
           classElement.setAttribute("where", type);


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

    }

    protected void addTableCell(Document doc, Element parent, String content) {
        Element cell = doc.createElement("table:table-cell"),
                text = doc.createElement("text:p");
    Text textNode = doc.createTextNode(content);
    text.appendChild(textNode);
        //text.setTextContent(content);
        cell.appendChild(text);
        parent.appendChild(cell);
    }
View Full Code Here

      try {
      NodeList lSchedules = mSchedules.getElementsByTagName( "schedule" );
      for( int i = 0; i < lSchedules.getLength(); i++ ) {
         Node lSchedule = lSchedules.item( i );
         NodeList lAttributes = lSchedule.getChildNodes();
         Text lItem = getNode( lAttributes, "target-mbean-name" );
         if( lItem == null ) {
            log.error( "No 'target-mbean-name' is specified therefore this Schedule is ignored" );
            continue;
         }
         log.info( "Got 'target-mbean-name' element: " + lItem + ", node value: " + lItem.getData() + lItem.getChildNodes() );
         String lTarget = lItem.getData();
         lItem = getNode( lAttributes, "target-method-name" );
         if( lItem == null ) {
            log.error( "No 'target-method-name' is specified therefore this Schedule is ignored" );
            continue;
         }
         String lMethodName = lItem.getData();
         lItem = getNode( lAttributes, "target-method-signature" );
         if( lItem == null ) {
            log.error( "No 'target-method-signature' is specified therefore this Schedule is ignored" );
            continue;
         }
         String lMethodSignature = lItem.getData();
         lItem = getNode( lAttributes, "date-format" );
         String dateFormat = null;
         if (lItem != null)
         {
            dateFormat = lItem.getData();
            if (dateFormat != null && dateFormat.trim().length() != 0)
            try
            {
               new SimpleDateFormat(dateFormat);
            }
            catch (Exception e)
            {
              log.error( "Invalid date format therefore this Schedule is ignored", e);
              continue;
            }
         }
         lItem = getNode( lAttributes, "start-date" );
         if( lItem == null ) {
            log.error( "No 'start-date' is specified therefore this Schedule is ignored" );
            continue;
         }
         String lStartDate = lItem.getData();
         lItem = getNode( lAttributes, "period" );
         if( lItem == null ) {
            log.error( "No 'period' is specified therefore this Schedule is ignored" );
            continue;
         }
         String lPeriod = lItem.getData();
         lItem = getNode( lAttributes, "repetitions" );
         if( lItem == null ) {
            log.error( "No 'repetitions' is specified therefore this Schedule is ignored" );
            continue;
         }
         String lRepeptions = lItem.getData();
         try {
            // Add Schedule
            int lID = addSchedule(
               new ObjectName( lTarget ),
               lMethodName,
View Full Code Here

    }

    protected void addTableCell(Document doc, Element parent, String content) {
        Element cell = doc.createElement("table:table-cell"),
                text = doc.createElement("text:p");
    Text textNode = doc.createTextNode(content);
    text.appendChild(textNode);
        //text.setTextContent(content);
        cell.appendChild(text);
        parent.appendChild(cell);
    }
View Full Code Here

     
   }
  
   private Element createTextNode(Document doc, String name, String value){
     
      Text node = doc.createTextNode(name);
      node.setNodeValue(String.valueOf(value));
      Element child = doc.createElement(name);
      child.appendChild(node);
      return child;
     
     
View Full Code Here

    return checkpoint(eq);
  }
 
  static void consolidateText(Element e) {
    NodeList l = e.getChildNodes();
    Text agg = null;
    for (int i=0; i<l.getLength(); i++) {
      if (l.item(i).getNodeType()==Node.TEXT_NODE) {
        Text txt = (Text) l.item(i);
        if (agg!=null) {
          agg.setTextContent(agg.getTextContent()+txt.getTextContent());
          txt.setTextContent("");
        }
        else agg = txt;
      }
      else agg = null;
    }
View Full Code Here

   *
   */

  private void addNode(Document answerXml, Element e, String field, String value) {
    Element newElement = answerXml.createElement(field);
    Text textNode = answerXml.createTextNode(value);
    newElement.appendChild(textNode);
    e.appendChild(newElement);
  }
View Full Code Here

  }

  private void addNodeNS(String ns, String uri, Document answerXml, Element e,
      String field, String value) {
    Element newElement = answerXml.createElement(field);
    Text textNode = answerXml.createTextNode(value);
    newElement.appendChild(textNode);
    newElement.setAttribute("xmlns:" + ns, uri);
    e.appendChild(newElement);
  }
View Full Code Here

            String s    = new String(ch, start, length);

            if ((node != null) && (node.getNodeType() == Node.TEXT_NODE)) {
                ((Text) node).appendData(s);
            } else {
                Text text = getDocument().createTextNode(s);

                getCurrentNode().appendChild(text);
            }
        }
View Full Code Here

TOP

Related Classes of org.w3c.dom.Text

Copyright © 2018 www.massapicom. 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.