[xsd-users] xsd include path

Boris Kolpackov boris at codesynthesis.com
Mon Dec 14 06:10:35 EST 2009


Hi Benjamin,

Benjamin Schindler <bschindler at inf.ethz.ch> writes:

> I'm having big trouble with our large projects: I cannot guarantee in
> which folder the program is called due to operating system / build
> system differences. The program is a server and receives an xml stream
> which it validates against some xsd's. Is there some way to set a root
> path against which xsd's are validated? Otherwise, locating xsd's is a
> very difficult job...

The best way to resolve this is to pre-load the schemas as shown in the 
'caching' example in the examples/cxx/tree/ directory. This way you can
specify absolute paths to the schema files. The added advantage of this
approach is that you can re-use the schemas for validating more than one
document.

There is also a way to pre-compile the schema and embed them directly into
the application. For more information on how to do this see the 'embedded'
example which can get here:

http://www.codesynthesis.com/~boris/tmp/xsd-3.2.0-embedded.tar.gz
http://www.codesynthesis.com/~boris/tmp/xsd-3.2.0-embedded.zip

Boris



More information about the xsd-users mailing list