[xsd-users] Output location and symbol conflicts.

Boris Kolpackov boris at codesynthesis.com
Wed Feb 9 09:57:54 EST 2011


Hi Daniel,

Daniel.roy.Kaasa at kongsberg.com <Daniel.roy.Kaasa at kongsberg.com> writes:

> 1. I would like to have XSD generate the output for two differently 
>    located paths, (.h) files in one location and (.cpp) in another. 
>    For example, my project is structured as so ./cpp/include/gml (.h)
>    and ./cpp/gml/generated (cpp). Currently I am using regex options
>    to modify the include statements and executing a perl script to
>    move the files explicitly and this is tedious. It would be nice
>    if it were possible to have a switch for specifying --output-h-dir
>    and --output-c-dir. In addition that the includes were prefixed
>    to reflect the header file locations.

While it will be possible to add the options you have mentioned, 
automatically figuring out the include prefix will be a bit too much
magic for XSD to handle. Consider something like this:

xsd cxx-tree --output-h-dir ../include/foo --output-c-dir src/bar

What should the include prefix be? It can be 'foo' (-I ../include),
or empty (-I ../include/foo). Or it can be ../../include/foo. The XSD
compiler has no way of guessing which one you have in mind.


> 2. My projects are partitioned with dynamic libraries, but my problem
>    is specifically with DLLs on windows. I have followed the documentation
>    for exporting and importing, using the options --import-maps and 
>    --export-maps. However I am running into problems symbols conflicts
>    with the xml_schema::simple_type<> being defined across several dlls.
>    For example I am importing symbols from dlls which contain generated
>    parsers into other dependent dlls of parsers.
> 
> xlink.dll <--gml.dll <--filter.dll

You need to generate the XML Schema namespace into a separate file 
(--generate-xml-schema), place this file into the "root" DLL (xlink.dll
in your case is a good candidate), and then use that file in all other
schemas (--extern-xml-schema).

Boris



More information about the xsd-users mailing list