try {
if (result == null) {
//no result has been produced yet, should we pass the facet
// parsed text in? only for simple types or complex types with
// mixed content
XSDTypeDefinition type = null;
if (Schemas.nameMatches(instance.getDeclaration(), binding.getTarget())) {
//instance binding
type = instance.getTypeDefinition();
} else {