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.length() > 0)) {
QName qname = null;
int index = schemaType.indexOf(XMLConstants.COLON);
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);
}
}
}
currentNode = node;
Object convertedValue = key.convertValueBasedOnSchemaType(value, xmlCnvMgr, this);