public Element toXML (XMLWriter writer) throws IOException { writer.write (this); return this; }
@Override public BasicNode toXML (XMLWriter writer) throws IOException { writer.write (this, getPreSpace ()); String prefix = getNamespace ().getPrefix (); if (prefix.length () != 0) { writer.write (this, prefix); writer.write (this, ":"); } writer.write (this, getName ()); writer.write (this, getEqualsSpace ()); char[] buffer = new char[1]; buffer[0] = (char)quoteChar; String s = new String (buffer); writer.write (this, s); if (rawValue != null) writer.write (this, rawValue); else writer.writeAttributeValue (this, getValue (), quoteChar); writer.write (this, s); return this; }
public DocTypeNotation toXML (XMLWriter writer) throws IOException { writer.write (this, "<!NOTATION"); if (nodes.isEmpty ()) { writer.write (this, " "); writer.write (this, name); writer.write (this, " "); writer.write (this, Character.toString (quoteChar)); writer.write (this, text); writer.write (this, Character.toString (quoteChar)); } else { // TODO Sync nodes with setters for (Node n: nodes) n.toXML (writer); } writer.write (this, ">"); return this; }
/** Append the content of this node to <code>writer</code> */ public BasicNode toXML (XMLWriter writer) throws IOException { writer.write (this, getValue ()); return this; }
public DocTypeEntity toXML (XMLWriter writer) throws IOException writer.write (this, "<!ENTITY"); writer.write (this, " %"); writer.write (this, name); writer.write (this, " "); writer.write (this, Character.toString (quoteChar)); writer.write (this, text); writer.write (this, Character.toString (quoteChar)); writer.write (this, " "); writer.write (this, notationName); writer.write (this, ">");
public DocTypeAttributeList toXML (XMLWriter writer) throws IOException { writer.write (this, "<!ATTLIST"); if (!Character.isWhitespace (elementName.charAt (0))) writer.write (this, " "); writer.write (this, elementName); boolean needsWhitespace = true; if (Character.isWhitespace (elementName.charAt (elementName.length () - 1))) needsWhitespace = false; if (needsWhitespace && !nodes.isEmpty ()) { Node n = nodes.get (0); if (n.getType () == Type.DTD_WHITESPACE) needsWhitespace = false; } if (needsWhitespace) writer.write (this, " "); for (Node n: nodes) n.toXML (writer); writer.write (this, ">"); return this; }