Re: [xml] libxml2 RELAX NG example code

On Thu, Jun 08, 2006 at 09:30:17AM +1000, John Hockaday ga gov au wrote:

Here is a simple UNIX command lines to validate an XML file using a RELAXNG

first set the location of the catalog file;

export SGML_CATALOG_FILES="/public/data/asddgate/etc/sgml/relaxcatalog.xml"

next run the command to validate an XML file using the RELAXNG schema:

/usr/local/bin/xmllint --noout --catalogs --relaxng
/home/relaxng/anzmeta-1.3.1.rng  xmlfile.xml

I have to set the SGML_CATALOG_FILES element because the anzmeta-1.3.1.rng
schema references many character entity references.  Your RELAXNG schema may
not do that so you may not have to set the SGML_CATALOG_FILES environment

  and xmllint.c code can be looked at to see how RelaxNG was used.


Daniel Veillard      | Red Hat
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]