QName idlType,
TypeCode tc,
XmlSchemaObject schemaType)
throws CorbaBindingException {
try {
StartElement startEl = reader.nextEvent().asStartElement();
Iterator attrIter = startEl.getAttributes();
String anySchemaType = null;
while (attrIter.hasNext()) {
Attribute attr = (Attribute)attrIter.next();
QName attrName = attr.getName();
if (attrName.getNamespaceURI().equals(XSI_NAMESPACE_URI)
&& attrName.getLocalPart().equals("type")) {
anySchemaType = attr.getValue();
break;
}
}
Characters charEl = null;
XMLEvent event = reader.nextEvent();
if (event.isStartElement()) {
startEl = event.asStartElement();
charEl = reader.nextEvent().asCharacters();
} else {
charEl = event.asCharacters();
}
reader.nextEvent().asEndElement();
CorbaAnyHandler obj = new CorbaAnyHandler(startEl.getName(), idlType, tc, null);
obj.setValueFromData(orb, charEl.getData(), anySchemaType);
return obj;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
LOG.log(Level.SEVERE, "Error: Object not correctly defined in the XML reader");