[xsd-users] xsd namespace confusion for iterator types

Boris Kolpackov boris at codesynthesis.com
Mon Dec 1 13:39:55 EST 2008


Hi Daniel,

Macumber, Daniel <Daniel_Macumber at nrel.gov> writes:

> Hello, I am using CodeSynthesis cxx-tree 3.2.0 it looks like some of the
> iterator types do not anchor the "xsd::cxx" namespace to the root c++
> namespace (e.g. "::xsd::cxx").  This causes the code not to compile if
> our target namespace also includes an "xsd".  I was able to fix this
> problem by performing the following find and replace on the generated
> code:
> 
>  
> 
> "xsd::cxx::tree::sequence< T >::iterator" ->
> "::xsd::cxx::tree::sequence< T >::iterator"
> 
> "xsd::cxx::tree::sequence< T >::const_iterator" ->
> "::xsd::cxx::tree::sequence< T >::const_iterator"

This is actually intentional and it has to do with the IntelliSense
support in VC++ 8.0. For some reason it does not like fully-qualified
names here so we had to use the unqualified version as a work-around.
If you remove --generate-intellisense from the command line, everything
should work out of the box (apart from IntelliSense in VC++ 8.0). If
you need the IntelliSense support and cannot upgrade  to VC++ 9.0 then
I am afraid the only way to fix this is to re-map your 'xsd' namespace
to some other name with the help of the --namespace-map option.

> Thanks a lot, every other indication we've had is that the xsd-cxx tool
> is great!

Thanks, I am glad you enjoy it.

Boris




More information about the xsd-users mailing list