Re: [xml] Validation - controlling schema location directory?



Geir S. Eidissen schrieb:

The validation is run from different computers (Windows) in a LAN and
I want to avoid having to distribute all schemas to every computer and
instead point libxml to a common directory on the server.

Is there a way to tell xmlSchemaValidateDoc to pick the schemas from a
specified directory, overriding schemalocation directory ?

It is definitely possible somehow, as xmllint can do this out of the
box. You might want to check the source code for xmllint, that should
tell you how it can be done.

$ xmllint --noout --schema ~/ds/ds.xsd bc.xml
bc.xml validates

$ xmllint --noout --schema http://localhost/ds/ds.xsd bc.xml
bc.xml validates

Make your schemas available via HTTP, than it should work. If local
copies turn out to be needed, consider using XML catalogues.

$ xmllint | grep -C1 -i catalog

--
Michael Ludwig



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