[xsd-users] multiple schemas in one program

Cook, Rich cook47 at llnl.gov
Thu Mar 1 13:36:24 EST 2012


Aha, I looked at --namespace-map but would never would have guessed that URL went there for any reason!  Thanks
-- Rich 

On Mar 1, 2012, at 7:48 AM, Boris Kolpackov wrote:

> 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

-- 
✐Richard Cook   
✇ Lawrence Livermore National Laboratory
Bldg-453 Rm-4024, Mail Stop L-557        
7000 East Avenue,  Livermore, CA, 94550, USA
☎ (office) (925) 423-9605    
☎ (fax) (925) 423-6961
---
Information Management & Graphics Grp., Services & Development Div., Integrated Computing & Communications Dept.
(opinions expressed herein are mine and not those of LLNL)






More information about the xsd-users mailing list