[xsd-users] xs:double truncation

Aaron Bray ARA/SED abray at ara.com
Fri Jun 20 16:24:23 EDT 2008


I did not have the --extern-xml-schema compiler option

I can see that when I use it, it replaces the following include block

#include <xsd/cxx/tree/exceptions.hxx>
#include <xsd/cxx/tree/elements.hxx>
#include <xsd/cxx/tree/types.hxx>

#include <xsd/cxx/xml/error-handler.hxx>

#include <xsd/cxx/xml/dom/auto-ptr.hxx>

#include <xsd/cxx/tree/parsing.hxx>
#include <xsd/cxx/tree/parsing/byte.hxx>
#include <xsd/cxx/tree/parsing/unsigned-byte.hxx>
#include <xsd/cxx/tree/parsing/short.hxx>
#include <xsd/cxx/tree/parsing/unsigned-short.hxx>
#include <xsd/cxx/tree/parsing/int.hxx>
#include <xsd/cxx/tree/parsing/unsigned-int.hxx>
#include <xsd/cxx/tree/parsing/long.hxx>
#include <xsd/cxx/tree/parsing/unsigned-long.hxx>
#include <xsd/cxx/tree/parsing/boolean.hxx>
#include <xsd/cxx/tree/parsing/float.hxx>
#include <xsd/cxx/tree/parsing/double.hxx>

#include <xsd/cxx/xml/dom/serialization-header.hxx>
#include <xsd/cxx/tree/serialization.hxx>
#include <xsd/cxx/tree/serialization/byte.hxx>
#include <xsd/cxx/tree/serialization/unsigned-byte.hxx>
#include <xsd/cxx/tree/serialization/short.hxx>
#include <xsd/cxx/tree/serialization/unsigned-short.hxx>
#include <xsd/cxx/tree/serialization/int.hxx>
#include <xsd/cxx/tree/serialization/unsigned-int.hxx>
#include <xsd/cxx/tree/serialization/long.hxx>
#include <xsd/cxx/tree/serialization/unsigned-long.hxx>
#include <xsd/cxx/tree/serialization/boolean.hxx>
#include <xsd/cxx/tree/serialization/float.hxx>
#include <xsd/cxx/tree/serialization/double.hxx>

#include <xsd/cxx/tree/std-ostream-operators.hxx>

With the name of the .xsd file, only it changes the .xsd to .hxx

Is it recommended that I have a xsd file that includes all the following
but replaces double.hxx with the .hxx files provided in the sample zip?

If not all base types are undefined
error C2504: 'string' : base class undefined


-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com] 
Sent: Friday, June 20, 2008 2:39 PM
To: Aaron Bray ARA/SED
Cc: xsd-users at codesynthesis.com
Subject: Re: [xsd-users] xs:double truncation

Hi Aaron,

Aaron Bray ARA/SED <abray at ara.com> writes:

> I have converted over to using the provided examples for double and
> decimal parsing and serialization
> It seems they are conflicting one another in definitions though.
> What would the correct way to remedy this situation?
> 
> double-parsing.hxx(37) : error C2953:
'xsd::cxx::tree::traits<double,C>'
> : class template has already been defined
> 1>        
> c:\program files\codesynthesis xsd
> 3.1\include\xsd\cxx\tree\parsing\double.hxx(28) : see declaration of
> 'xsd::cxx::tree::traits<double,C>'

The double.hxx file shouldn't be included by the generated code
if you are customizing the xsd:double and xsd:decimal types. I
think one of the two things happen:

1. You don't have the following options when generating xml-schema.hxx
   (in which case double.hxx will be included by xml-schema.hxx)

   --custom-type double=double 
   --custom-type "decimal=long double"

2. You don't have the following option when compiling some of your
   schemas (in which case double.hxx will be included by the
   generated header files for those schemas):

   --extern-xml-schema xml-schema.xsd

Can you check if any of this is happening? If not, can you search
the generated code to see which file(s) include double.hxx?

Boris




More information about the xsd-users mailing list