use of nu.xom.ProcessingInstruction in project teiid by teiid.
the class BinaryXMLCodec method writeDocument.
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");
}
Aggregations