[xsd-users] Capturing schema version number

Ray Lischner rlischner at proteuseng.com
Thu Feb 17 08:09:15 EST 2011


We are using C++/Tree 3.3.0. We need to be able to record the schema version number in the generated code when the schema provides the version attribute. What I'd like to do is to declare an extern std::string or char array in the generated header, with the definition in the generated source file. I can easily write a script to get the schema version, but the --prologue and --epilogue switches insert their text outside the generated namespace. This is usually what I want, but in this case, I want to inject text inside the namespace. How do I do that?

At this point, the only two options I see are:

1. Modify xsd to generate the information I want. Add, say, --generate-version-string switch.
2. Write a script to post-process the generated source files.

Are there any other options?

Ray Lischner,
Distinguished Member of Technical Staff
133 National Business Pkwy, Ste 150     t. 443.539.3448
Annapolis Junction, MD 20701                c. 410.854.5170
rlischner at proteuseng.com                     f. 443.539.3370

This electronic message and any files transmitted with it contain information
which may be privileged and/or proprietary. The information is intended for use
solely by the intended recipient(s). If you are not the intended recipient, be
aware that any disclosure, copying, distribution or use of this information is
prohibited. If you have received this electronic message in error, please advise
the sender by reply email or by telephone (443.539.3400) and delete the message.


More information about the xsd-users mailing list