Re: [xml] XML Schema is confusing

On Tue, May 15, 2001 at 11:54:49AM -0400, Mark Kotyk wrote:
I'm currently working on a project that reads an XML Schema and generates C code
to read and write a document of that type (sort of like CORBA IDL's).  At first,
I was going to go with full blown document validation, but decided that it would
be better handled by the xml parsing lib. 

In my exploration, I discovered that XML Schema has a schema of its own, written
in (of course) XML Schema.  This recursive definition trickles down quite a
ways, to where it defines the types of facets a "simpleType" may have.

The question I pose is this:  Is it better to write some sort of bootstrap
Schema validator/compiler(??) that in turn reads the W3C "XML Schema" schema and
validates the document from there, or just hardcode the whole schema validator.

Future flexibility vs complexity?

  This is such a good question that I feel obligated to ask Henry Thompson
both in his role of editor of that part of the Schemas REC and as the
implementor of the W3C Schemas validator, he probably have a clear opinion
on the subject.
  Last time I read the Schemas specification I could not get myself to
answer this question properly. There is some pros and cons:

    - from a formal point of view it's quite better,
    - it probably lead to more maintainable code and easier to extend.
    - code will be smaller

    - if not "compiled-in" it may incomb a longer start delay
    - will use more dynamic memory (code vs data).
    - it may make code a bit harder to understand (higher level)

  I still think the pros win, but it may make the work of starting this
implementation a bit harder.
  Now if we could from the original schemas derive C code which could
be compiled to implement that core within the library then it's probably
the best option, it retains the flexibility and lower the number of line
of code to maintain, without the drawback of running this generation
process at runtime.


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml Gnome XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]