[XOM-interest] FW: Schema validation using XOM

Michael Kay mike at saxonica.com
Fri Apr 25 10:17:03 EDT 2008


> Creating the StreamSource object, as input to the 
> SchemaFactory.newInstance method, from a File object instead 
> of an InputStream object, has cured the problem, and XOM now 
> validates against the schema. We're still not entirely sure 
> why this small change makes a difference

The difference is that when you supply a File object the base URI of the
document is known, whereas if you supply an InputStream then the base URI
isn't known, unless you also supply a SystemId. This will mean that relative
URI references within the document cannot be resolved. You then get into
rules (or interpretations of rules) about whether it's an error to refer to
a schema that doesn't exist, or whether the reference is simply ignored.

Michael Kay
http://www.saxonica.com/



More information about the XOM-interest mailing list