# @dtf:schema-validate Annotation

Specifies if the source parameters and/or the return value should be schema validated. The schema-validate annotation is an optional annotation associated with @dtf:transform methods.

Syntax

@dtf:schema-validate

return-value="true" | "false"
parameters="true" | "false"

Attributes

return-value

If this parameter is set to true, during run time, if the return type has an associated schema, it will be validated against its schema type after the transformation is executed. A typed XML return value will be schema validated against its XML Schema and a typed non-XML return value will be validated against the schema in the MFL file. A return types which is untyped or is a Java primitive will not be validated because it does not have an associated schema.

parameters

If this parameter is set to true, during run time, the source parameters that have an associated schema will be validated against their schema types before the transformation is executed. All typed XML parameters will be schema validated against their XML Schema and typed non-XML parameters will be validated against the schema in the MFL file. Source parameters which are untyped or are Java primitives will not be validated because they do not have an associated schema.

Remarks

In the following example, the @dtf:schema-validate annotation defines that during run time, when the transformation method myXQueryMethod is executed, the return value will be schema validated but the source parameters of the transformation method will not, as shown highlighted in bold in the following code segment:

    /**
     * @dtf:transform xquery-ref="myXQueryMethod.xq"
     * @dtf:schema-validate return-value="true" parameters="false"
     */
    public abstract noNamespace.SupplierDocument myXQueryMethod(noNamespace.PurchaseOrderDocument PurchaseOrderDoc);

Related Topics

See "Schema Validating During Run Time" in Validating in the Guide to Data Transformation.

@dtf:transform Annotation