[xsd-users] #include directives & relative paths

Boris Kolpackov boris at codesynthesis.com
Wed Dec 13 04:40:05 EST 2006


Hi David,

Moss, David R (SELEX Comms) (UK Christchurch) <david.r.moss at selex-comm.com> writes:


> Just to clarify: Are these XSD commands applied after the schema file
> has been parsed? If this is the case then there is still the issue of
> having to specify complete paths in the actual schema file for include
> and import statements to compile without

Yes, the transformations are applied after the schemas have been parsed.
They specify how XML Schema include and import declarations are mapped
to C++ #include directives.


> error: 'schema\basic-types.xsd': unable to open in read mode
>
> messages - by the way, wouldn't 'file not found at <path>' be a more
> accurate message here :-)

It definitely would but it would also require digging further for the
reason why the open failed. It can be because the file is not present,
you don't have permissions, or your hard drive head just scratched the
platter :-). When you factor in the platform differences, it becomes
a somewhat complicated matter. That's why XSD simply prints what it
tried to do and that the operation has failed.


> Is it possible for XSD to check the 'path' environment variable to get
> round this; a --use-path command or similar? Or would this just be
> violating the standards?!

I was thinking about adding an option similar to CPP's -I for
include/import directory searching but decided against it. This is
something that no other schema processor is supporting so such a
feature will lead you to developing schemas that are not usable with
anything except XSD. I think using relative paths is a pretty standard
and universally-supported practice. With the new --include-regex option
you will be able to transform those paths to use more powerful features
of the C++ preprocessor.

I am going to implement the --include-regex option. Would you like a
precompiled binary?


thanks,
-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20061213/ff88f449/attachment.pgp


More information about the xsd-users mailing list