W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2002

Re: Question about different content-model for element w/ same name

From: Ian Stokes-Rees <ijs@decisionsoft.com>
Date: Tue, 23 Jul 2002 12:51:34 +0100
To: Jeroen Koops <jeroen@empanda.net>
Cc: Dare Obasanjo <dareo@microsoft.com>, "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-ID: <20020723125132.Z29544@decisionsoft.com>

I think that you will find the XercesJ-2 schema model is aiming to do
exactly this.  Also, it is not meant to _only_ do implicit validation of
a document -- i.e. document driven schema validation.  It is very
possible to set Xerces up to only validate particular known instance
documents and load namespaces and schemas into and out of memory (i.e.
to activate and deactiveate them).  We have a number of products which
do exactly this for application driven schema validation of instance
documents.  XercesJ-2 has been a complete re-write of XercesJ-1 and I
think you'll find a lot of effort has been put into making it well
designed and sensible so that the PSVI is available in the DOM tree of
the parsed (and schema validated) instance document.


On Tue, Jul 23, 2002 at 11:19:47AM +0200, Jeroen Koops wrote:
> On Tue, 23 Jul 2002, Ian Stokes-Rees wrote:
> > Unless it is for the academic exercise, you will probably find you are
> > better off using one of:
> > 
> > Xerces-J (generally taken to be the most accurate schema validating XML
> >           parser available)
> > Xerces-C
> > Oracle XDK (not sure about the licensing status of this)
> > 
> Ian,
> The reason I'm venturing into writing my own schema-validator is twofold:
> The first reason is, as you say, the academic exercise. The schema-spec is
> quite complex, and as far as I'm concerned, there's no better way to get
> familiar with it than to try and implement a tool like this.
> The second reason is the fact that all existing schema-implementations
> (wll, at least the ones I know of) all treat schema-validation implicitly:
> that is, whenever they can find a schema for a certain document, and
> schema-validation is turned on, they will use the schema, and parsing the
> instance-document will fail if it doesn't conform to the schema.
> What I really need is a toolkit which does the following:
> * Read a schema-document and compile it to some internal form.
> * read an instance-document and compile it to some internal form, probably
> a DOM-tree.
> * Ask the validator to check the instance-document against the compiled
> schema, thereby maintaining a connection between each node in the instance
> document and teh schema-element validating it.
> * Allow me to query the validated document for things like:
>   - Can I delete this node from the instance-document and still
>     have a conforming document?
>   - What attributes can this node carry?
>   - What nodes can I insert after this node?
> I admit that this is quite ambitious, but I'm progressing better then I
> expected initially. And even  if I decide to give up halfway through, I'll
> have learned quite a bit about Xml schemas :)
>  --
> Jeroen Koops
> Empanda Software Development
> jeroen@empanda.net
> +31-6-24686577

Ian Stokes-Rees, Client Services      DecisionSoft Limited
+44-1865-203192                       http://www.decisionsoft.com
Received on Tuesday, 23 July 2002 07:51:52 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:04 UTC