protected void printComment(Comment comment, boolean endWithComma) { String text = comment.getData().trim(); if (text.length() >0) { printIndent(); print("/* "); print(text); printEnd(" */", endWithComma); } }
/** * Serializes a Comment Node. * * @param node The Comment Node to serialize */ protected void serializeComment(Comment node) throws SAXException { // comments=true if ((fFeatures & COMMENTS) != 0) { String data = node.getData(); // well-formed=true if ((fFeatures & WELLFORMED) != 0) { isCommentWellFormed(data); } if (fLexicalHandler != null) { // apply the LSSerializer filter after the operations requested by the // DOMConfiguration parameters have been applied if (!applyFilter(node, NodeFilter.SHOW_COMMENT)) { return; } fLexicalHandler.comment(data.toCharArray(), 0, data.length()); } } }
final String data = currentComment.getData(); final int length = data.length();
/** * Serializes a Comment Node. * * @param node The Comment Node to serialize */ protected void serializeComment(Comment node) throws SAXException { // comments=true if ((fFeatures & COMMENTS) != 0) { String data = node.getData(); // well-formed=true if ((fFeatures & WELLFORMED) != 0) { isCommentWellFormed(data); } if (fLexicalHandler != null) { // apply the LSSerializer filter after the operations requested by the // DOMConfiguration parameters have been applied if (!applyFilter(node, NodeFilter.SHOW_COMMENT)) { return; } fLexicalHandler.comment(data.toCharArray(), 0, data.length()); } } }
String data = ((Comment) node).getData();
String data = ((Comment) node).getData();
String data = ((Comment) node).getData();
String data = ((Comment) node).getData();
return createComment(((Comment) node).getData());
protected void printComment(final Comment comment, final boolean endWithComma) { String text = comment.getData().trim(); if (text.length() > 0) { printIndent(); print("/* "); print(text); printEnd(" */", endWithComma); } }
/** * @param xmlNode XML node * @param xmlStreamWriter XML stream writer * @throws XMLStreamException the XML stream exception */ public static void writeNode(Node xmlNode, XMLStreamWriter xmlStreamWriter) throws XMLStreamException { if (xmlNode instanceof Element) { addElement((Element) xmlNode, xmlStreamWriter); } else if (xmlNode instanceof Text) { xmlStreamWriter.writeCharacters(xmlNode.getNodeValue()); } else if (xmlNode instanceof CDATASection) { xmlStreamWriter.writeCData(((CDATASection) xmlNode).getData()); } else if (xmlNode instanceof Comment) { xmlStreamWriter.writeComment(((Comment) xmlNode).getData()); } else if (xmlNode instanceof EntityReference) { xmlStreamWriter.writeEntityRef(xmlNode.getNodeValue()); } else if (xmlNode instanceof ProcessingInstruction) { ProcessingInstruction procInst = (ProcessingInstruction) xmlNode; xmlStreamWriter.writeProcessingInstruction(procInst.getTarget(), procInst.getData()); } else if (xmlNode instanceof Document) { writeToDocument((Document) xmlNode, xmlStreamWriter); } }
/** * Constructor for creating a comment from a DOM node. * Originally provided by Erdal Karaca. * @param comment DOM node */ public FComm(final Comment comment) { this(comment.getData()); }
/** * Constructor for creating a comment from a DOM node. * Originally provided by Erdal Karaca. * @param comment DOM node */ public FComm(final Comment comment) { this(comment.getData()); }
/** * Present a comment Node as a String. * @param comment the Comment Node. * @return the String representation of the Comment node. */ private String commentToString(Comment comment) { return "<!--" + comment.getData() + "-->\n"; }
public Object getValue() { if (node.getNodeType() == Node.COMMENT_NODE) { String text = ((Comment) node).getData(); return text == null ? "" : text.trim(); } return stringValue(node); }
public boolean enter(Comment comment) { try { String s = comment.getData(); lexical_.comment(s.toCharArray(), 0, s.length()); } catch(SAXException saxexception) { _errorReport(saxexception); } return false; }
public String getText() { if (content instanceof Text) { return ((Text)content).getData(); } else if (content instanceof Comment) { return ((Comment)content).getData(); } return DOMUtils.getRawContent(getCurrentNode()); }
public String getText() { if (content instanceof Text) { return ((Text)content).getData(); } else if (content instanceof Comment) { return ((Comment)content).getData(); } return DOMUtils.getRawContent(getCurrentNode()); }
public String getText() { if (content instanceof Text) { return ((Text)content).getData(); } else if (content instanceof Comment) { return ((Comment)content).getData(); } return DOMUtils.getRawContent(getCurrentNode()); }
protected void printComment(Comment comment, boolean endWithComma) { String text = comment.getData().trim(); if (text.length() >0) { printIndent(); print("/* "); print(text); printEnd(" */", endWithComma); } }