Transform a Comment CSNode entity into a Comment object that can be added to a Content Specification.

@param node The CSNode to be transformed.
@return The transformed Comment object.
189645
protected static Comment transformComment(CSNodeWrapper node) {
        final Comment comment;
        if (node.getNodeType() == CommonConstants.CS_NODE_COMMENT) {
            comment = new Comment(node.getTitle());
        } else {
            throw new IllegalArgumentException("The passed node is not a Comment");
        }

        comment.setUniqueId(node.getId() == null ? null : node.getId().toString());

        return comment;
    }
704565
public static Comment toComment(Document doc, Object o) throws PageException {
	if (o instanceof Comment) return (Comment) o;
	else if (o instanceof CharacterData) return doc.createComment(((CharacterData) o).getData());
	return doc.createComment(Caster.toString(o));
    }
1091268
protected Node removeNode( Node node )
    {
        // Remove node.
        node.previous.next = node.next;
        node.next.previous = node.previous;
        node.removed = true;
        return node;
    }
551051
protected function _commentNode()
    {
        $this->_codeNode();
        $token = $this->_stream->current(true);
        $this->_states['body'] = $token[1];
        $node = new NodeDef($this->_states['body'], 'comment');
        return $this->_contextualize($node);
    }
932922
private String toXml(Node node) {
        try {
            Transformer transformer = TransformerFactory.newInstance().newTransformer();
            StreamResult result = new StreamResult(new StringWriter());
            DOMSource source = new DOMSource(node);
            transformer.transform(source, result);
            return result.getWriter().toString();
          } catch(TransformerException ex) {
              throw new IllegalArgumentException("Could not transform "  +node + " to XML", ex);
          }
    }
2912
def _do_comment(self, node):
        '''
        '''
        if not _in_subset(self.subset, node): return
        if self.comments:
            W = self.write
            if self.documentOrder == _GreaterElement: W('\n')
            W('<!--')
            W(node.data)
            W('-->')
            if self.documentOrder == _LesserElement: W('\n')
1014022
public Node<T> node(T content) {
    final Node<T> search = nodes.get(content);
    if (search != null)
      return search;
    final Node<T> n = new Node<>(content, this);
    nodes.put(content, n);
    return n;
  }
428359
function getCommentSL() {
  const type = NodeType.CommentSLType;
  const token = tokens[pos];
  const line = token.ln;
  const column = token.col;
  const content = tokens[pos++].value.substring(2);
  const end = !content ? [line, column + 1]
    : getLastPosition(content, line, column + 2);

  return newNode(type, content, line, column, end);
}
680595
function(node) {
        var data;
        if(this.xmldom) {
            data = node.xml;
        } else {
            var serializer = new XMLSerializer();
            if (node.nodeType == 1) {
                // Add nodes to a document before serializing. Everything else
                // is serialized as is. This may need more work. See #1218 .
                var doc = document.implementation.createDocument("", "", null);
                if (doc.importNode) {
                    node = doc.importNode(node, true);
                }
                doc.appendChild(node);
                data = serializer.serializeToString(doc);
            } else {
                data = serializer.serializeToString(node);
            }
        }
        return data;
    }
373626
public static org.w3c.dom.Element convert(org.jdom2.Element node) throws JDOMException
	{
		if (node == null)
			return null; // Convert null->null

		try
		{
			DOMOutputter outputter = new DOMOutputter();

			return outputter.output(node);
		}
		catch (JDOMException e)
		{
			throw new RuntimeException("Error converting JDOM to DOM: " + e.getMessage(), e);
		}
	}
1342951
public void transform(XmlNode node, StringBuilder builder) {
        switch (node.getType()) {
            case XmlNode.ELEMENT_NODE: {
                builder.append("<");
                builder.append(node.getName());
                for (XmlNode attribute : node.getAttributes().values()) {
                    transform(attribute, builder);
                }
                builder.append(">");
                for (XmlNode child : node.getChildren()) {
                    transform(child, builder);
                }
                builder.append("</");
                builder.append(node.getName());
                builder.append(">");
            }
                break;
            case XmlNode.ATTRIBUTE_NODE: {
                builder.append(" ");
                builder.append(node.getName());
                builder.append("=\"");
                builder.append(node.getValue());
                builder.append("\"");
            }
                break;
            case XmlNode.TEXT_NODE: {
                builder.append(node.getValue());
            }
        }
    }
336290
public static String nodeToString(Node document) throws Exception {
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();

        Source xmlSource = new DOMSource(document);
        Result outputTarget = new StreamResult(outputStream);
        Transformer transformer = TransformerFactory.newInstance().newTransformer();
        transformer.transform(xmlSource, outputTarget);

        return outputStream.toString();
    }
608035
protected function compileComment(Node $node)
    {

        $content = $this->compileChildren($node->children, true, true);

        return $node->rendered ? $this->createMarkupComment($content) : $this->createPhpComment($content);
    }
1196709
public static Node newUndefinedNode(Node srcReferenceNode) {
    Node node = IR.voidNode(IR.number(0));
    if (srcReferenceNode != null) {
      node.useSourceInfoFromForTree(srcReferenceNode);
    }
    return node;
  }
449205
public <E> ObjectGraph generateGraph(E entity, PersistenceDelegator delegator, NodeState state)
    {

        this.builder.assign(this);
        Node node = generate(entity, delegator, delegator.getPersistenceCache(), state);
        this.builder.assignHeadNode(node);
        return this.builder.getGraph();
    }
854175
private void transformTextNode(Node node) {

        // only do some output if we are in writing mode
        if (m_write) {
            String helpString = node.getNodeValue();
            m_tempString.append(helpString);
        }
    }
57033
public final Node buildNode(Object entity, PersistenceDelegator pd, Object entityId, NodeState nodeState)
    {
        String nodeId = ObjectGraphUtils.getNodeId(entityId, entity.getClass());

        Node node = this.graph.getNode(nodeId);

        // If this node is already there in graph (may happen for bidirectional
        // relationship, do nothing and return null)
        // return node in case has already been traversed.

        if (node != null)
        {
            if (this.generator.traversedNodes.contains(node))
            {
                return node;
            }

            return null;
        }

        node = new NodeBuilder().assignState(nodeState).buildNode(entity, pd, entityId, nodeId).node;
        this.graph.addNode(node.getNodeId(), node);
        return node;

    }