use of org.eclipse.wst.xml.xpath2.api.typesystem.ComplexTypeDefinition in project webtools.sourceediting by eclipse.
the class NodeType method getXDMTypedValue.
// getTypedValueForPrimitiveType
/*
* Construct the "typed value" from a "string value", given the simpleType of the node.
*/
protected ResultSequence getXDMTypedValue(TypeDefinition typeDef, List itemValTypes) {
if ("anySimpleType".equals(typeDef.getName()) || "anyAtomicType".equals(typeDef.getName())) {
return new XSUntypedAtomic(getStringValue());
} else {
SimpleTypeDefinition simpType = null;
if (typeDef instanceof ComplexTypeDefinition) {
ComplexTypeDefinition complexTypeDefinition = (ComplexTypeDefinition) typeDef;
simpType = complexTypeDefinition.getSimpleType();
if (simpType != null) {
// element has a complexType with a simple content
return getTypedValueForSimpleContent(simpType, itemValTypes);
} else {
// element has a complexType with complex content
return new XSUntypedAtomic(getStringValue());
}
} else {
// element has a simpleType
simpType = (SimpleTypeDefinition) typeDef;
return getTypedValueForSimpleContent(simpType, itemValTypes);
}
}
}
Aggregations