[xsd-users] Re: Adding namspaces

Matt Burnham mwburn at mhpcc.hpc.mil
Tue Jul 11 22:38:43 EDT 2006


   Boris,
   I've upgraded to 2.2.0 and am using the --namespace-map to add in a
   namespace, and everything is working great (and the 2.2.0 release
   couldn't have come at a better time).
   I have one last issue that I need to fix ASAP.  I need to create an
   in-memory tree and then serialize it to XML.
   I have it all working except for the "detail" section.  When I parse
   this section, I use the keep-dom flag, and then load the various
   sub-schema's using the xerces DOMElement's.  So I'm not sure how to
   "create" the tree on the fly.  I'm assuming I need to create new
   DOMElements and populate them, but can't seem to get it working.
   Thanks,
   Matt
   Boris Kolpackov wrote:

Hi Matt,

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



   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.


Hm, that's strange. I compiled CoT event.xsd with the following command
(using XSD 2.1.1):

$ xsd cxx-tree --namespace-regex '/.* /foo::bar/' event.xsd

The resulting event.cxx compiles fine for me with g++. Can you provide
exact steps to reproduce this error? Also note that if you have any
.xsd files including or importing event.xsd, you will need to pass
the --namespace-regex option above when you compile them.

I also tried the new 2.2.0:

$ xsd cxx-tree --namespace-map =foo::bar event.xsd

And it also works fine.


hth,
-boris

References

   1. mailto:mwburn at mhpcc.hpc.mil



More information about the xsd-users mailing list