Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XSD Schema and Validation problems

xom-interest AT

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: peter murray-rust <pm286 AT>
  • To: Elliotte Harold <elharo AT>
  • Cc: 'xom-interest' <xom-interest AT>
  • Subject: Re: [XOM-interest] XSD Schema and Validation problems
  • Date: Mon, 19 Dec 2005 14:17:53 +0000

At 13:09 19/12/2005, Elliotte Harold wrote:
peter murray-rust wrote:

[Note - I do not like the idea of adding schema references within the XML instance but it seems to be one of the current ways of using XSD. I do not actually like XSD at all, but feel that I am constrained to use it - it solves ca 10% of validation problems in chemistry. Schematron adds somewhat more but ultimately we need much more expressive semantics.]

I suspect you need a custom type library and RELAX NG to really handle this use case. See

Many thanks - I think this is very close to my current approach which is to subclass every element at add the constraints in Java. You are starting to convince me that I should refactor to RELAX-NG - (how) does XOM support this - is it likely to be less problematic than Xerces? My schema is extensive but simple and modular - all elements, attributes and types are in separate xsd:* elements so I hope it should be easy to transform it to RELAX-NG in an automatic manner.

I hope this isn't off-topic (if so please mail separately), but my design includes the use of extensive dictionaries (perhaps with 1000 or more terms) all of which can be turned into schema-elements. There is a core of objects (ca 100) that serve the most straightforward cases and the others (for example a 4th rank tensor) are assembled on demand from (currently) XSD-like code in the dictionaries. It might make sense for this to use RELAX-NG instead.

This error message comes from Xerces. See which I just filed. However your specific problem (50% certainty) is using a FileReader. Don't do that. FileReaders don't know where they came from and thus cannot resolve relative URLs. Plus they're more likely to get the encoding wrong than right. Instead try this:

Thanks for this - it sounds a promising diagnosis.


Elliotte Rusty Harold elharo AT
XML in a Nutshell 3rd Edition Just Published!

Peter Murray-Rust
Unilever Centre for Molecular Sciences Informatics
University of Cambridge,
Lensfield Road, Cambridge CB2 1EW, UK

Archive powered by MHonArc 2.6.24.

Top of Page