Re: [xml] Will xmllint use schematron?



On Wed, May 11, 2005 at 11:11:07AM +0100, Steve Little wrote:
  I read http://www.schematron.com/iso/ quickly. I didn't understand it.

It's not a very good site, IMHO. However, schematron itself is quite a
neat idea.

  When thinking about implementing something I read the spec. I didn't 
understood that one on the first pass though.

It seems it would require XSLT and EXSLT so it would not be implementable
at the libxml2 level since XSLT and EXSLT are provided in libraries separate
from libxml2.

I believe that only XPath is required, so it would be possible, but I
agree with Daniel that it would be better implemented as a seperate tool
on top of libxml/libxslt.

  Well if it really don't requires xslt/exslt then that would be doable.

The implementation is fairly trivial, and there are existing
implementations in XSLT:

It looks simple, problably the reason why I didn't understood the spec :-)

http://xml.ascc.net/schematron/1.5/

I've used some of the sample metastylesheets with xsltproc, and have had
no problems. If you really want a programatic interface, here's a simple
start point...
[...]
You could make a metastylesheet makes it trivial to analyse the output for
problems.

  if it really requires only XPath then a C implementation with full
report would probably be less than 500 lines based on existing libxml2
stuff.

Alternatively, you can parse the schematron schemafile yourself,
implement each tag, check the XPaths etc, and thus make a libxml only
version. Arguably that's a waste of time though, when there's a Free XSLT
implementation.

  did it really got the ISO standard stamp yet ? If it's short, blessed
by ISO, sensible and amount to less than 1000 lines of C and 20KB of code
I wouldn't mind getting it added to libxml2.

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://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]