Object value = textChild.getNodeValue();
return convertValue(node, key, value);
}
private Object convertValue(Element node, XMLField key, Object value) {
XMLConversionManager xmlCnvMgr = (XMLConversionManager) session.getDatasourcePlatform().getConversionManager();
if (key.isTypedTextField() && (node != null)) {
String schemaType = node.getAttributeNS(XMLConstants.SCHEMA_INSTANCE_URL, XMLConstants.SCHEMA_TYPE_ATTRIBUTE);
if ((null != schemaType) && (!schemaType.equals(""))) {
QName qname = null;
int index = schemaType.indexOf(':');
if (index == -1) {
qname = new QName(schemaType);
Class convertClass = key.getJavaClass(qname);
return xmlCnvMgr.convertObject(value, convertClass);
} else {
String prefix = schemaType.substring(0, index);
String localPart = schemaType.substring(index + 1);
XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform();
String url = xmlPlatform.resolveNamespacePrefix(node, prefix);
qname = new QName(url, localPart);
Class convertClass = key.getJavaClass(qname);
return xmlCnvMgr.convertObject(value, convertClass, qname);
}
}
}
return key.convertValueBasedOnSchemaType(value, xmlCnvMgr);
}