[xsd-users] #include directives & relative paths

Moss, David R (SELEX Comms) (UK Christchurch) david.r.moss at selex-comm.com
Wed Dec 13 04:23:20 EST 2006


Hi Boris,

See comments below.

Cheers
Dave.

Dave Moss
SELEX Communications
Grange Road
Christchurch 
Dorset  BH23 4JE
United Kingdom
Tel: + 44 (0) 1202 404841
Email: david.r.moss at selex-comm.com


> 
> Hi David,
> 
> Long time, no see ;-)

[Moss, David R] 
Thanks, I've been very busy :-)


> 
> Hm, right now --include-prefix is just added to the full path from
> the schema include statement:
> 
> #include <generated/../../root/schema/basic-types.hxx>

[Moss, David R] 
Yes, I saw that, which made sense after I thought about it - and sorry
for the inconsistency in my example there; some 'real' code leaked in!


> 
> One way to address this would be to have an option to strip the
directory
> part from the path before applying --include-prefix, so that we end up
> with
> 
> #include <generated/basic-types.hxx>
> 
> The problems with this solution are as follows:
> 
> 1. It will strip the directory part from all paths. It is quite
possible
>    one may want to keep it in some #include's and strip it in others.

[Moss, David R] 
Agreed.


> 2. What if one wants to strip only a part of the directory. For
example
>    what if you wanted your #include directive to be relative to root:
> 
>    #include <base/generated/basic-types.hxx>

[Moss, David R] 
That's sounds like a useful feature too.
 

> So it seems to me like a full-blown regex replacement mechanism is in
> order here. It will address both of the above problems and will allow
> one to implement non-trivial transformations on the include paths.
> What do you think?

[Moss, David R] 
That would be the most flexible solution.

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

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 :-) 

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?!


> 
> 
> thanks,
> -boris

********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************





More information about the xsd-users mailing list