Package org.w3c.dom

Examples of org.w3c.dom.Comment


        throws Exception
    {
        final Document document = createDocument();
        final String name = "meep";
        final Element element = document.createElement( name );
        final Comment comment = document.createComment( "comment" );
        element.appendChild( comment );
        final Configuration configuration = ConfigurationUtil.toConfiguration( element );

        assertEquals( "configuration.getName()", name, configuration.getName() );
        assertEquals( "configuration.getPath()",
View Full Code Here


        else
          entity.appendChild(resultDocument.createTextNode(""));
        currentElement.appendChild(entity);
        break;
      case ParserInstruction.AddComment:
        Comment comment = resultDocument.createComment(domArgument);
        currentElement.appendChild(comment);
        break;
      case ParserInstruction.SetTitle:
        Element titleNode = createElementNS(resultDocument, currentNamespaceURI, "title");
        titleNode.appendChild(resultDocument.createTextNode(fixText(domArgument)));
View Full Code Here

     * Lexical Handler method to create comment node in DOM tree.
     */
    public void comment(char[] ch, int start, int length) {
  appendTextNode();
  final Node last = (Node)_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

      // build the XML in memory using DOM
      DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
      Document doc = builder.newDocument();

      // Add a comment
      Comment comment = doc.createComment(" automatically produced by XMLAttributePersistenceManager ");
      doc.appendChild(comment);
     
      // Insert root element
      Element root = doc.createElement(AL_ROOT_ELEMENT);
      root.setAttribute(AL_ID_ATTRIBUTE, origId);
View Full Code Here

  if (ignoreComments || inDTD) {
      return;
        }

        String text = new String(ch, start, length);
        Comment comment = document.createComment(text);
        ParentNode top = elementStack[topOfStack];
       
  try {
      top.appendChild(comment);
  } catch (DOMException ex) {
View Full Code Here

          }
          jobNames.add(jobName);
          Node importedJob = configurationDoc.importNode(jobElement, true);
          cron2jobMapping.put(currentLine, jobElement);         
          if (lastComment.length()>0){
            Comment jobComment = configurationDoc.createComment(lastComment);
            jobsElement.appendChild(jobComment);
          }
          jobsElement.appendChild(importedJob);
          lastComment="";
        }       
View Full Code Here

        format.setIndenting(true);
        format.setIndent(2);
        format.setOmitXMLDeclaration(true);
            XMLSerializer serializer = new XMLSerializer(out, format);
            serializer.serialize(runTimeDocument);
            Comment runTimeComment = jobDoc.createComment("This run_time is currently not supported:\n"+out.toString());
            jobElement.appendChild(runTimeComment);
      } else{
        jobElement.appendChild(runTimeElement);
      }
      jobDoc.appendChild(jobElement);
View Full Code Here

      for (Iterator itV = bsnSet.iterator(); itV.hasNext();) {
        final BundleArchive ba = (BundleArchive) itV.next();
        final String targetName = ba.bsn + "-" + ba.version;
        targetNames.append(",").append(targetName);

        final Comment comment = doc.createComment(ba.relPath);
        final Element target = doc.createElement("target");
        target.setAttribute("name", targetName);

        final Element mvnDeployBundle = doc.createElement("mvn_deploy_bundle");
        target.appendChild(doc.createTextNode("\n"+prefix2));
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 = (Node)_nodeStk.peek();
  Comment comment = _document.createComment(new String(ch,start,length));
  if (comment != null) last.appendChild(comment);
    }
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

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.