Package org.w3c.dom

Examples of org.w3c.dom.Comment


        xpathNodeTracker.visited(attr);
        assertEquals("root element attribute", "/root[1]/@type", xpathNodeTracker.toXpathString());            
               
        xpathNodeTracker.indent();
               
        Comment comment = doc.createComment("testing a comment");
        xpathNodeTracker.visited(comment);
        assertEquals("comment", "/root[1]/comment()[1]", xpathNodeTracker.toXpathString());

        ProcessingInstruction pi = doc.createProcessingInstruction("target","data");
        xpathNodeTracker.visited(pi);
View Full Code Here


        }
        if (!fIncludeComments || fFilterReject) {
            return;
        }
        if (!fDeferNodeExpansion) {
            Comment comment = fDocument.createComment (text.toString ());
           
            setCharacterData (false);
            fCurrentNode.appendChild (comment);
            if (fDOMFilter !=null &&
            (fDOMFilter.getWhatToShow () & NodeFilter.SHOW_COMMENT)!= 0) {
View Full Code Here

        }
        if (!fIncludeComments || fFilterReject) {
            return;
        }
        if (!fDeferNodeExpansion) {
            Comment comment = fDocument.createComment (text.toString ());
           
            setCharacterData (false);
            fCurrentNode.appendChild (comment);
            if (fDOMFilter !=null && !fInEntityRef &&
            (fDOMFilter.getWhatToShow () & NodeFilter.SHOW_COMMENT)!= 0) {
View Full Code Here

            fDeferredDocumentImpl.appendChild(fCurrentNodeIndex, comment);
        }

        // full node expansion
        else {
            Comment comment = fDocument.createComment(fStringPool.orphanString(dataIndex));
            fCurrentElementNode.appendChild(comment);
        }

    } // comment(int)
View Full Code Here

            // that can accept it.
            readUnknownPropertyValueFromXMLElement(curElem, aParser, aOptions, foundProperties);
          }
        }
      } else if (curNode instanceof Comment) {
        Comment curElem = (Comment) curNode;
        String comment = curElem.getData();
      }
    }
  }
View Full Code Here

    Element xBusStations = doc.createElement("busStations");
    parentElement.appendChild(xBusStations);

    for (RoadSpotModel b : busStations) {
      Comment description = doc.createComment(b.getDescription());
      xBusStations.appendChild(description);

      Element xBusStation = doc.createElement("busStation");
      xBusStations.appendChild(xBusStation);
     
View Full Code Here

      dfactory.setValidating(false);
      dfactory.setNamespaceAware(true);

      DocumentBuilder db = dfactory.newDocumentBuilder();
      Document doc = db.newDocument();
      Comment c1 = doc.createComment("Small Comment Test");

      doc.appendChild(c1);

      Element root = doc.createElementNS(null, "RootElement");
      Element e1 = doc.createElementNS(null, "Element1");
View Full Code Here

     */
    protected Comment createCommentWrapper(Comment c) {
        if (c == null) {
            return null;
        }
        Comment result = (Comment)getNode(c);
        if (result == null) {
            result = new CommentWrapper(this, c);
            nodes.put(c, new WeakReference(result));
        }
        return result;
View Full Code Here

        systemElement.setAttribute(A_TYPE, getTypeString(type));
        root.appendChild(systemElement);
        if (includeTime) {
            if (created > 0) {
                String message = "Create time is " + (new Date(created));
                Comment comment = doc.createComment(message);
                systemElement.appendChild(comment);
            }

            Element timeElement = null;
            if (!USE_NS) {
                timeElement = doc.createElement(E_ATTR);
            } else {
                timeElement = doc.createElementNS(NS_URI, E_ATTR);
            }
            timeElement.setAttribute(A_NAME, E_CREATED);
            timeElement.setAttribute(A_VALUE, Long.toString(created));
            systemElement.appendChild(timeElement);

            if (modified > 0) {
                String message = "Modified time is " + (new Date(modified));
                Comment comment = doc.createComment(message);
                systemElement.appendChild(comment);
            }
            if (!USE_NS) {
                timeElement = doc.createElement(E_ATTR);
            } else {
View Full Code Here

    /**
     * Lexical Handler method to create comment node in DOM tree.
     */
    public void comment(char[] ch, int start, int length) {
        final Node last = nodeStk.peek();
        Comment comment = document.createComment(new String(ch, start, length));
        if (comment != null) {
            if (last == root && nextSibling != null) {
                last.insertBefore(comment, nextSibling);
            } else {
                last.appendChild(comment);
View Full Code Here

TOP

Related Classes of org.w3c.dom.Comment

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.