Re: [xml] schemas



On Mon, Feb 04, 2002 at 08:43:54PM -0500, T.J. Mather wrote:
I'm interested in adding support for XML Schema to libxml.  I was 
wondering if such a contribution would be welcome, given the API freeze.  

  Sure it's welcome ! I never managed to get the time and energy to
start it but it's on my TODO list for ages (I started but dropped
work on it one year and a half ago).
  I think this can be developed on top of the existing API, 
one of the "design errors" of libxml2 is that DTD validation requires
DOM support. Ideally the Schema validation should be done on top
of SAX, possibly as a "transparent module" i.e. a module intercepting
the SAX events, processing them, and forwarding them to the next
layer. Problem with such a scheme is that all the namespace computations
are done in the DOM building module ... 
  Anyway, the best is probably to develop the code to work on top
of the DOM view, and then if needed retrofit it to work on either
DOM or SAX event, after all being able to validate an arbitrary fragment
of a DOM tree is extremely useful too. And working on the tree view
should not need API or representation changes (at most API additions)
except maybe for storing PSVI informations (c.f. some previous discussions
about standardizing the way _private should be used).

I was thinking that it would be neat to develop a Multi-Schema XML 
validator, much like Sun's Multi-Schema XML Validator[1].  We could build 
support for XML Schema at first, then add support for RELAX NG.  This 
shouldn't be too hard, if we take care separate the XML Schema datatypes
from the rest of the Schema implementation, since RELAX NG can support XML 
Schema datatypes.

  Yep, separate the data representation view and the API to validate it.
Then multiple schema validation mechanisms may be used.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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