// this type parameter can be always casted into DatabindableDatatype.
// if you are using RELAX NG, then it depends on the situation.
if(!(type instanceof DatabindableDatatype)) {
System.out.print("not databindable");
} else {
DatabindableDatatype dt = (DatabindableDatatype)type;
// the createJavaObject method can be used to convert this literal
// into Java friendly object. Here, we use the context object
// which is passed through the startDocument method.
Object javaObject = dt.createJavaObject( literal, context );
// dump the class name for a proof that an object is actually created.
System.out.print( javaObject.getClass().getName() );
}
System.out.print(" : ");
System.out.println(literal.trim());