[xsd-users] Re: Adding namspaces

Boris Kolpackov boris at codesynthesis.com
Thu Jul 13 11:38:49 EDT 2006


Hi Matt,

Matt Burnham <mwburn at mhpcc.hpc.mil> writes:

>    If I add the namespace to my test case (a simple event and embedded
>    schema) it works fine,  when I use the actual CoT schema's I get the
>    errors.
>
>    I'm using the following to generate the cxx-tree:
>
>    xsd.exe cxx-tree --root-element event --morph-anonymous --namespace-regex
>    /.*/cot/ --generate-inline --generate-ostream --generate-serialization
>    cot_event.xsd
>
>    In order to get the namespace added:
>    1 - I can't enclode the regex with quotes
>    2 - The first expression can't have a space
>    3 - I still need the --root-element and --morph-anonymous for the root
>    event element

I tracked this problem down, in case you are interested. When you remove
the space from '/.* /cot/', it starts to also match XML Schema namespace
(actually it matches any XML namespace). As a result, both XML Schema and
CoT types are generated into the same C++ namespace (cot). It happened
that both namespaces define types with name 'type' which results in
redefinition. I think on Windows you can use " instead of ', e.g.,
--namespace-regex "/.* /cot/"

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/20060713/a32f4c81/attachment.pgp


More information about the xsd-users mailing list