[xsd-users] Mapping for string-based enumerations: string constructors?

Yury Zaytsev yury.zaytsev at traveltainment.de
Wed Mar 11 06:15:07 EDT 2015


Hi,

I've noticed that in the C++/Tree generated bindings, string-based 
enumerations have additional constructors that allow users to specify 
arbitrary strings, bypassing the restrictions imposed by the schema.

According to the documentation [*] this is an expected behavior; I 
understand how a string constructor could be useful, but I'm not quite 
sure of what's the use case for allowing arbitrary strings?

[*]: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#2.6.2

Is there any built-in facility to easily disable these additional 
constructors, or make them reject strings that aren't part of the enum?

I've checked the examples which show how to customize the mappings, but it 
looks rather scary. Instead, I would be happier to maintain a patch 
against XSD, especially if this can be eventually included in the official 
version in the future.

Any thoughts?

-- 
Dr. Yury V. Zaytsev
Senior Software Developer
IT Data Production

TravelTainment GmbH
Carlo-Schmid-Straße 12
52146 Würselen/Aachen, Germany
yury.zaytsev at traveltainment.de

http://www.traveltainment.de

Amtsgericht Aachen, HRB 15873
Geschäftsführer: Bernhard Steffens (Vorsitzender),
Dr. Oliver Rengelshausen



More information about the xsd-users mailing list