[xsd-users] Error in building the generated header due to XSD runtime version mismatch

William Canton stargate625 at gmail.com
Thu Mar 3 17:23:57 EST 2011


Hi Boris,

I eventually found out that my workspace in Visual Studio C++ has multiple
projects.  As it happened, some of the projects still referenced the old 3.2
version.  After I fixed all the project properties, the CodeSynthesis could
generate the version number embedded in the corresponding *.hxx files
correctly.

However, there is another problem though.  The CodeSynthesis doesn't seem to
be able to parse a valid XML document with optional field elements.  For
example, if my XML file contains an empty optional <EISSDescriptor/>, the
xerces parser would throw exception at runtime.  Again, it took me a while
to discover this problem by removing the empty EISSDescriptor elements from
the XML document.

Is this a bug in the CodeSynthesis?  Attached is the standard XML schema
file that I used to generate the classes.  Please try it to see if you will
encounter the same anomaly that I stumbled upon.

William


On Thu, Mar 3, 2011 at 3:00 PM, Boris Kolpackov <boris at codesynthesis.com>wrote:

> Hi William,
>
> William Canton <stargate625 at gmail.com> writes:
>
> > This error was reported in one of my generated *.hxx file at the line:
> >
> > #if (XSD_INT_VERSION != 3030000L)
> > #error XSD runtime version mismatch
> > #endif
> >
> > But hovering over the macro XSD_INT_VERSION showed a correct version
> number
> > of 3030000L.  How could this happen?
>
> Hm, this is strange. Does it happen with all the generated files or only
> this
> one?
>
> Also, can you open (by right-clicking on it in the source code and
> selecting
> the "Open Document" menu item) the <xsd/cxx/config.hxx> file that is
> included
> at the beginning of the generated header file. Then do the same for
> <xsd/cxx/version.hxx> and see if the version defined there is correct.
>
> You may also want to double check if there is a previous version of XSD
> installed somewhere on your machine.
>
> Boris
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BigHunt_example.xml
Type: text/xml
Size: 11255 bytes
Desc: not available
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20110303/9b2f21b9/BigHunt_example-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: standard_cdf.xsd
Type: application/octet-stream
Size: 75353 bytes
Desc: not available
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20110303/9b2f21b9/standard_cdf-0001.obj


More information about the xsd-users mailing list