/** {@inheritDoc} */ public void write(Document doc) throws IOException { writeXMLDeclaration(); for (int i = 0; i < doc.getChildCount(); i++) { writeChild(doc.getChild(i)); } writeEndDocument(); }
/** {@inheritDoc} */ public void write(Document doc) throws IOException { writeXMLDeclaration(); for (int i = 0; i < doc.getChildCount(); i++) { writeChild(doc.getChild(i)); } writeEndDocument(); }
private void writeDocument(Document doc) throws IOException { if (DEBUG) System.err.println("writing document"); writeXMLDeclaration(doc.getBaseURI()); for (int i = 0; i < doc.getChildCount(); i++) { Node node = doc.getChild(i); if (node instanceof Element) { writeElement((Element) node); } else if (node instanceof Comment) { writeComment((Comment) node); } else if (node instanceof ProcessingInstruction) { writeProcessingInstruction((ProcessingInstruction) node); } else if (node instanceof DocType) { writeDocType((DocType) node); } else { throw new IllegalAddException("Cannot write node type: " + node); } } writeEndDocument(); if (DEBUG) System.err.println("finished writing document"); }
private void writeDocument(Document doc) throws IOException { if (DEBUG) System.err.println("writing document"); writeXMLDeclaration(doc.getBaseURI()); for (int i = 0; i < doc.getChildCount(); i++) { Node node = doc.getChild(i); if (node instanceof Element) { writeElement((Element) node); } else if (node instanceof Comment) { writeComment((Comment) node); } else if (node instanceof ProcessingInstruction) { writeProcessingInstruction((ProcessingInstruction) node); } else if (node instanceof DocType) { writeDocType((DocType) node); } else { throw new IllegalAddException("Cannot write node type: " + node); } } writeEndDocument(); if (DEBUG) System.err.println("finished writing document"); }
} else if (node instanceof Document) { Document doc = (Document) node; for (int j=0; j < doc.getChildCount(); j++) { item.appendChild(doc.getChild(j).copy());
} else if (node instanceof Document) { Document doc = (Document) node; for (int j=0; j < doc.getChildCount(); j++) { item.appendChild(doc.getChild(j).copy());
for (int j=0; j < doc.getChildCount(); j++) { Node child = doc.getChild(j); if (mayBreakLine && indentYes && child instanceof Element) {
for (int j=0; j < doc.getChildCount(); j++) { Node child = doc.getChild(j); if (mayBreakLine && indentYes && child instanceof Element) {