[xsd-users] error processing multiple schemas at once

Eric Broadbent Eric.Broadbent at csr.com
Wed Nov 2 16:41:26 EDT 2011


Hi Boris - thanks very much for your reply.
After I send off my query I realized that running it separately was probably the thing I needed to do and had to divert to something else before I could try that.
Makes sense to have only one driver generated, so supplying more than one "root-element" option is not meaningful I guess.

I'll try this and report back if it doesn't work as expected.
Many thanks.
-Eric B.

On Nov 2, 2011, at 3:27 PM, Boris Kolpackov wrote:

> Hi Eric,
> 
> Eric Broadbent <Eric.Broadbent at csr.com> writes:
> 
>> So I tried running XSD with multiple schemas: (same command as I used 
>> originally but just added the other schemas on the end)
>> 
>> 	xsd cxx-parser --show-sloc --force-overwrite --show-anonymous 
>> --root-element subset_root --generate-test-driver --generate-print-impl 
>> --generate-validation --xml-parser expat subset_schema.xsd shared-types.xsd 
>> shared-resources xsd 
>> 
>> This time, it didn't appear to accept the "--root-element" option"
>> 
>> 	xsd: error: unable to generate the test driver without a global
>> element (document root)
> 
> When you specify --generate-test-driver, XSD will try to generate a
> driver for each schema you passed. If there is no global element in
> any of them, then you will get the above error. The solution to this
> is to compile the "included/imported" schemas without this option and
> then compile the "root" schema (the one that defines the global element)
> separately with this option:
> 
> xsd cxx-parser --show-sloc --force-overwrite --show-anonymous 
> --generate-print-impl  --generate-validation --xml-parser expat 
> shared-types.xsd shared-resources.xsd 
> 
> xsd cxx-parser --show-sloc --force-overwrite --show-anonymous 
> --root-element subset_root --generate-test-driver --generate-print-impl 
> --generate-validation --xml-parser expat subset_schema.xsd
> 
> Boris
> 
> 
> To report this email as spam click https://www.mailcontrol.com/sr/wQw0zmjPoHdJTZGyOCrrhg== .



Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog



More information about the xsd-users mailing list