generatePrefixMappingEvents(omElement, false);
}
private void generateEventsForChildren(OMContainer parent) throws SAXException {
for (Iterator it = parent.getChildren(); it.hasNext(); ) {
OMNode node = (OMNode)it.next();
switch (node.getType()) {
case OMNode.DTD_NODE:
if (lexicalHandler != null) {
OMDocType doctype = (OMDocType)node;
lexicalHandler.startDTD(doctype.getRootName(), doctype.getPublicId(), doctype.getSystemId());
lexicalHandler.endDTD();
}
break;
case OMNode.ELEMENT_NODE:
generateEvents((OMElement)node);
break;
case OMNode.TEXT_NODE:
generateEvents((OMText)node, false);
break;
case OMNode.SPACE_NODE:
generateEvents((OMText)node, true);
break;
case OMNode.CDATA_SECTION_NODE:
if (lexicalHandler != null) {
lexicalHandler.startCDATA();
}
generateEvents((OMText)node, false);
if (lexicalHandler != null) {
lexicalHandler.endCDATA();
}
break;
case OMNode.COMMENT_NODE:
if (lexicalHandler != null) {
char[] ch = ((OMComment)node).getValue().toCharArray();
lexicalHandler.comment(ch, 0, ch.length);
}
break;
case OMNode.PI_NODE:
OMProcessingInstruction pi = (OMProcessingInstruction)node;
contentHandler.processingInstruction(pi.getTarget(), pi.getValue());
break;
case OMNode.ENTITY_REFERENCE_NODE:
contentHandler.skippedEntity(((OMEntityReference)node).getName());
break;
default:
throw new IllegalStateException("Unrecognized node type " + node.getType());
}
}
}