handleText(text);
}
}
private void handleElement(SOAPElement element) throws SAXException {
Name elementName = element.getElementName();
if (getContentHandler() != null) {
if (namespacesFeature) {
for (Iterator<?> iterator = element.getNamespacePrefixes(); iterator.hasNext();) {
String prefix = (String) iterator.next();
String namespaceUri = element.getNamespaceURI(prefix);
getContentHandler().startPrefixMapping(prefix, namespaceUri);
}
getContentHandler()
.startElement(elementName.getURI(), elementName.getLocalName(), elementName.getQualifiedName(),
getAttributes(element));
}
else {
getContentHandler().startElement("", "", elementName.getQualifiedName(), getAttributes(element));
}
}
for (Iterator<?> iterator = element.getChildElements(); iterator.hasNext();) {
Node child = (Node) iterator.next();
handleNode(child);
}
if (getContentHandler() != null) {
if (namespacesFeature) {
getContentHandler()
.endElement(elementName.getURI(), elementName.getLocalName(), elementName.getQualifiedName());
for (Iterator<?> iterator = element.getNamespacePrefixes(); iterator.hasNext();) {
String prefix = (String) iterator.next();
getContentHandler().endPrefixMapping(prefix);
}
}
else {
getContentHandler().endElement("", "", elementName.getQualifiedName());
}
}
}