[xsd-users] getting the xs:schema version value

Boris Kolpackov boris at codesynthesis.com
Wed Mar 26 04:50:57 EDT 2008


Hi Uri,

Uri Karagila <uri at hyperroll.com> writes:

> <xs:schema version="$Id: //hr/512/HyperRoll-Schema.xsd#11 $">.
>
> The issue is that the "version" attribute is not being "reflected" in
> the generated code, and therefore can not be retrieved. What can be
> done?

You can include this version information into the generated header
file using the prologue/epilogue mechanism (see the --hxx-prologue-*
options). For example as a constant:

const unsigned int schema_version = 11;

You can extract the version information manually (in which case
you will need to update your build scripts/makefiles every time
the version changes) or you can create a small program or script
that parses your schema as XML and automatically extracts the
version information. This program/script can generate the above
version constant into a file which can then be included into the
generated header with the --hxx-prologue-file option.

Boris




More information about the xsd-users mailing list