@Override protected org.w3c.dom.Element printElement(FormatStack fstack, NamespaceStack nstack, org.w3c.dom.Document basedoc, Element element) { Attribute href = element.getAttribute("href"); return (href == null || itemAccess(PERMISSION_READ, element, true)) ? super.printElement(fstack, nstack, basedoc, element) : null; }
@Override protected void printDeclaration(final Writer out, final FormatStack fstack) throws IOException { if (fstack.isOmitDeclaration()) { return; } if (fstack.isOmitEncoding()) { write(out, "<?xml version=\"1.0"); } else { write(out, "<?xml version=\"1.0\""); write(out, " encoding=\""); write(out, fstack.getEncoding()); } write(out, "\" standalone=\"yes\"?>"); write(out, "\n"); }
protected void printTextRemoveBreaks(final Writer out, final FormatStack fstack, final String text) throws IOException { if (fstack.getEscapeOutput()) { textRawRemoveBreaks(out, Format.escapeText(fstack.getEscapeStrategy(), fstack.getLineSeparator(), text)); return; } textRawRemoveBreaks(out, text); }
@Override protected void printNamespace(final XMLStreamWriter out, final FormatStack fstack, final Namespace ns) throws XMLStreamException { final String prefix = ns.getPrefix(); final String uri = ns.getURI(); // TODO handle namespace if (!ns.equals(namespace)) { out.writeNamespace(prefix, uri); } }