[xsd-users] Re: Adding namspaces

Matt Burnham mwburn at mhpcc.hpc.mil
Mon Jul 10 17:59:50 EDT 2006


   When I use this to add a namespace, the namespace is added, but then I
   get a lot of compiler errors when compiling the generated cxx file.
   Boris Kolpackov wrote:

Hi Matt,

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



For are the CoT schemas that I technically don't control, the "root"
elements have very generic names (event, request, etc.) that I'd like to
protect again name collisions.  Is there anyway to add a namespace to
the generated cxx-tree classes?  I've looked at the --namespace-map and
"prologue/postlogue" options, but don't seem to see anyway to do it.  If
needed, I would be willing to add an "xsn" to the schema if the
--namespace-map would work, I just don't know were to add it.


In 2.1.1 you will need to use the following option:

--namespace-regex '/.* /foo::bar/'

Here change foo::bar to whatever C++ namespace you need. In the upcoming
2.2.0, you will be able to write

--namespace-map =foo::bar

hth,
-boris

References

   1. mailto:mwburn at mhpcc.hpc.mil



More information about the xsd-users mailing list