[xsd-users] XSD compilation fails: "Global element declared more than once"

Björn Stresing bjoern.stresing at gmx.de
Thu May 7 08:46:58 EDT 2015


Hello,

I have a problem compiling a rather complicated schema with 
CodeSynthesis XSD XML Schema to C++ compiler 4.0.0. Since the schema is 
large and the definition spans some files with circular dependencies, 
I've tried to compile this beast in "--file-per-type" mode. However 
compilation fails with a bunch of "Global element xxx declared more than 
once" errors. I don't understand why the compiler complains since the 
schema seems to be valid (Eclipse says so).

The schema (only Annex-B  is of interest): 
http://standards.smpte.org/content/978-1-61482-595-1/suppl/2012/06/25/st-434-2006.DC1/st0434-2006.zip

The XSD compiler arguments (I only need 
./Annex-B/groups/s377m_metadata.xsd and all its dependencies):
cxx-tree --options-file mxf.options --file-per-type 
--generate-serialization ./Annex-B/groups/s377m_metadata.xsd

The mxf.options file:
--namespace-map 
"http://www.smpte-ra.org/schemas/434/2006/types/S377M/2004=s377mTypes"
--namespace-map 
"http://www.smpte-ra.org/schemas/434/2006/types/S422M/2006=s422mTypes"
--namespace-map 
"http://www.smpte-ra.org/schemas/434/2006/groups/S377M/2004=s377mGroups"
--namespace-map 
"http://www.smpte-ra.org/schemas/434/2006/groups/S381M/2005=s381mGroups"
--namespace-map 
"http://www.smpte-ra.org/schemas/434/2006/groups/S385M/2004=s385mGroups"
--namespace-map 
"http://www.smpte-ra.org/schemas/434/2006/groups/S380M/2004=s380mGroups"
--namespace-map 
"http://www.smpte-ra.org/schemas/434/2006/groups/S422M/2006=s422mGroups"
--namespace-map 
"http://www.smpte-ra.org/schemas/434/2006/groups/S429-6/2006=s429_6Groups"
--root-element-none

I hope there is some solution or workaround for this problem.
Best Regards,
Bjoern Stresing





More information about the xsd-users mailing list