[xsd-users] Which xsd compiler option could I use in order to isolate a redefine symbol within a namespace

Boris Kolpackov boris at codesynthesis.com
Tue May 22 08:08:12 EDT 2007


Hi Marc,

WAUTIER Marc <marc.wautier at eurocontrol.int> writes:

> When compiling the files generated by the xsd compiler, I get the
> following error message :
>
> Error 173: "AIXM-Features.hxx", line 404 # Redefined symbol
> 'SpecialDateType'; previously defined at
> ["/cm/vobs/esc/ESC/KERNEL/sources/include/SpecialDateState.h", line 29].
>
> Which xsd compiler option could I use in order to isolate the offending
> declaration within a namespace or to rename  the offending declaration ?

It seems like the generated type conflicts with an existing name in
SpecialDateState.h. The easiest way to resolve this is to instruct
XSD to put the generated code into a C++ namespace with the
--namespace-map option. If your schema does not have a target
namespace, then you can do:

--namespace-map =MyNamespace

Otherwise, something like this:

--namespace-map <target-namespace>=MyNamespace

Where <target-namespace> needs to be replaced with your schema's
target namespace.


> I tried the following without success:
>
>    xsd cxx-tree --anonymous-regex /SpecialDateType/EradSpecialDateType/
> --anonymous-regex-trace ${FILE}

This will only work if SpecialDateType in AIXM-Features.xsd is an anonymous
type.


>    xsd cxx-tree --custom-type-regex /SpecialDateType/EradSpecialDateType/
> ${FILE}

This will make SpecialDateType an alias for (custom) EradSpecialDateType,
but won't change its name.


hth,
-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070522/d20a6742/attachment.pgp


More information about the xsd-users mailing list