[xsd-users] multiple schemas in one program

Boris Kolpackov boris at codesynthesis.com
Thu Mar 1 10:48:22 EST 2012


Hi Rich,

Cook, Rich <cook47 at llnl.gov> writes:

> I am now having trouble using two different parsers in the same program:  
> One I built like this: 
> xsd cxx-tree --generate-serialization PursuerInputSchema.xsd  
> And one I built like this: 
> xsd cxx-parser PursuerDCDataSchema.xsd   
> 
> The trouble I'm having is each declares xml_schema::qname differently, 
> this causes a compiler error if I include both PursuerDCDataSchema.hxx
> and PursuerInputSchema.hxx in the same source file.  

Normally, you would use one mapping (cxx-tree or cxx-parser) in an
application (in other words, you normally only need to use cxx-tree
or cxx-parser, but not both). There are cases where one would want
to use several different mappings in the same application. In that
case, you will need to re-map the XML Schema namespace in one of
them to something other that xml_schema. For example:

xsd cxx-tree --generate-serialization PursuerInputSchema.xsd  
xsd cxx-parser --namespace-map http://www.w3.org/2001/XMLSchema=xml_schema_parser \
PursuerDCDataSchema.xsd

Boris



More information about the xsd-users mailing list