[xsd-users] xsd include path

Benjamin Schindler bschindler at inf.ethz.ch
Mon Dec 14 06:57:56 EST 2009


Hi

Thanks for the quick reply!

On 12/14/2009 12:10 PM, Boris Kolpackov wrote:
> 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.
>   
I have looked at this example - but I'm a bit unsure about the
semantics. What is the key for the cache-lookup? The path, the filename?
What happens if two files have the same name?
> 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:
>   
Thanks for the hint. I'm not sure whether that would work here as the
xsd's are modified (in form of a temporary file) at run-time when
plugins are loaded, so I cannot really compile schemas into the
application or can I modify the binary representations at run-time?
(i.e. add includes which are themselves then in form of a binary
representation)?

Thanks!
Benjamin
> 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