protected void _element(final Element element) throws IOException { String nodeName = resolveNodeName(element); appendable.append('<'); appendable.append(nodeName); int attrCount = element.getAttributesCount(); if (attrCount != 0) { for (int i = 0; i < attrCount; i++) { Attribute attr = element.getAttribute(i); appendable.append(' '); renderAttribute(element, attr, appendable); } } int childCount = element.getChildNodesCount(); if (element.selfClosed && childCount == 0) { appendable.append("/>"); return; } appendable.append('>'); if (element.voidElement) { return; } if (childCount != 0) { elementBody(element); } appendable.append("</"); appendable.append(nodeName); appendable.append('>'); }
@Override protected void elementBody(Element element) throws IOException { boolean hasXML = element.hasAttribute("xml-attrib"); // detects XML content if (hasXML) { configXML(); } super.elementBody(element); if (hasXML) { configHtml(); } }
protected void _element(final Element element) throws IOException { String nodeName = resolveNodeName(element); appendable.append('<'); appendable.append(nodeName); int attrCount = element.getAttributesCount(); if (attrCount != 0) { for (int i = 0; i < attrCount; i++) { Attribute attr = element.getAttribute(i); appendable.append(' '); renderAttribute(element, attr, appendable); } } int childCount = element.getChildNodesCount(); if (element.selfClosed && childCount == 0) { appendable.append("/>"); return; } appendable.append('>'); if (element.voidElement) { return; } if (childCount != 0) { elementBody(element); } appendable.append("</"); appendable.append(nodeName); appendable.append('>'); }
protected void _element(Element element) throws IOException { String nodeName = resolveNodeName(element); appendable.append('<'); appendable.append(nodeName); int attrCount = element.getAttributesCount(); if (attrCount != 0) { for (int i = 0; i < attrCount; i++) { Attribute attr = element.getAttribute(i); appendable.append(' '); renderAttribute(element, attr, appendable); } } int childCount = element.getChildNodesCount(); if (element.selfClosed && childCount == 0) { appendable.append("/>"); return; } appendable.append('>'); if (element.voidElement) { return; } if (childCount != 0) { elementBody(element); } appendable.append("</"); appendable.append(nodeName); appendable.append('>'); }