[xsd-users] XSD Libraries

Brad Howes howes at ll.mit.edu
Mon Jul 19 14:12:04 EDT 2010


On Jul 19, 2010, at 12:00 PM, Boris Kolpackov wrote:

> You can append prefixes to include guards using the --guard-prefix
> option. You can do it on the file-by-file basis which should allow
> you to make the guards unique across the generated files.


I don't think this will help. Take for example the following scenario:

    one.xsd: defines One
    two.xsd: defines Two, derived from One
    both.xsd: includes one.xsd and then two.xsd

The C++ generation for two.xsd will generate two.hxx which does this:

    #include "both.hxx"

and both.hxx does this:

    #include "two.hxx"
    #include "one.hxx"

Now two derives from one (note the order), but I cannot define Two, because when one.hxx tries to include both.hxx, it skips the other includes because the both.hxx guard macro protects from multiple loading, and thus one.hxx never gets loaded.

Brad

-- 
Brad Howes
Group 42
MIT Lincoln Laboratory • 244 Wood St. • Lexington, MA 02173
Phone: 781.981.5292 • Fax: 781.981.3495 • Secretary: 781.981.7420








More information about the xsd-users mailing list