Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] FW: Schema validation using XOM

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Michael Kay" <mike AT saxonica.com>
  • To: "'Marks, Chris'" <chris.marks AT landg.com>, <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] FW: Schema validation using XOM
  • Date: Fri, 25 Apr 2008 15:17:03 +0100

> 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/





Archive powered by MHonArc 2.6.24.

Top of Page