public Node addComment(String text) { return add(new XmlComment(text)); }
public Body(Node node, String offset, String dir, boolean addNewLine, Set<String> imports, ViewRenderingService viewRenderingService) { this.node = node; for (Node child : node.children()) { viewRenderingService.prepare(child, this, dir, offset, addNewLine, imports); } }
public String textOwn() { return text(false); }
public Map<String, String> attributes() { return node.attributes(); } }
public Node parse(Node xml, String s) { // check first char s = s.trim(); xml.lineNumber = 1; T context = createContext(); if (s.startsWith("<?xml ")) { context.i = s.indexOf("?>") + 2; context.parse(s.toCharArray(), xml); } else { context.parse(s.toCharArray(), xml); } return xml; }
public String toXML() { return toXML(false); }
@Override protected T createContext() { return (T) new HtmlParserContext(); }
@Override protected T createContext() { return (T) new GspParserContext(); }
protected String text(boolean recursive) { return ownText(); }
public String offset() { return offset(" "); }
protected T createContext() { return (T) new XmlParserContext(); }
@Override protected boolean isSelfClosedTag(String name) { if (name.equals("%@")) return true; return super.isSelfClosedTag(name); }
public String text() { return text(true); }
public StringBuilder toXML(boolean prettyPrint, StringBuilder sb) { return toXML(prettyPrint, true, sb); }
public StringBuilder toXML(boolean prettyPrint, boolean header, StringBuilder sb) { if (header) { sb.append("<?xml version=\"1.0\" encoding='UTF-8' ?>"); if (prettyPrint) sb.append("\n"); } toXML("", sb, prettyPrint); return sb; }