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

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

Received on Tuesday, 23 July 2002 05:19:57 UTC