Hi everyone.

I'm making good progress on the Distro-Constructor manifest.  I have 
written a mostly-complete first-cut RelaxNG schema and a test manifest.  
I can validate the test manifest using xmllint.  Schema and test 
manifest are attached.

I can parse the XML data into an in-memory DOM structure.  Next is to 
provide an easy-to-use set of interfaces (based on DOM interfaces) to 
read/change/add in-memory data.

RelaxNG does have its limitations.  While it's great for validating the 
format/syntax of XML documents (e.g. that all required attributes are 
present for a given item) and is easiest to read of the schema types I 
investigated, it does not do an adequate job of content/semantic 
validation.  (An example of content validation is that an IP address 
isn't set to "junk".)  RelaxNG, being a schema, does not set defaults 
either, since schemas come into play only during validation.

I propose a second manifest to specify defaults and node-specific 
content checking.  This second manifest would be shipped with the 
product, and is not intended for modification by end users.  An engine 
would read this manifest, and massage/check the in-memory data based on 
it.  This approach offers validation and setup of defaults which is as 
easy and maintainable as the schema.  The second manifest will require 
an update only when the schema changes, and both can be easily kept in sync.

Note that the in-memory data update mechanism to be used can also be 
used for layering.  Additional (sparse) manifests can be read for 
additional data, and changes layered on top of existing in-memory data.  
When layering is complete, the final data set can be checked against the 
schema.  It can also be saved as an XML doc for future reference or as a 
starting point for future changes.

Comments and suggestions are welcomed.

   Thanks,
    Jack

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: manifest.rng
URL: 
<http://mail.opensolaris.org/pipermail/caiman-discuss/attachments/20080325/a230a739/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-manifest.xml
Type: text/xml
Size: 4461 bytes
Desc: not available
URL: 
<http://mail.opensolaris.org/pipermail/caiman-discuss/attachments/20080325/a230a739/attachment.xml>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: xmllint-run
URL: 
<http://mail.opensolaris.org/pipermail/caiman-discuss/attachments/20080325/a230a739/attachment-0001.ksh>

Reply via email to