Not all XSD mappings to programming language constructs are possible
Posted by jpluimers on 2020/02/26
This post is a reminder to myself that not all mappings from XSD to programming languages are possible.
There are many impossible cases, so this is just a general reminder.
A Delphi specific case for instance is the mapping of enumerations: one reason is that XSD enumerations are case sensitive, but the Delphi language is not: [WayBack] Using XML Enumerations with Delphi XML Data Binding Wizard – Stack Overflow.
More generic examples from my answer to the above question:
- In XSD you can derive from an existing type in two ways: extending it and limiting it. Object Oriented languages only allow you extend when deriving.
- Delphi is not alone in these kinds of limitations. Generating wrappers from XSD schema’s is the field of specialized tools, even in the Java or .NET world.
I’ve seen horrible things with wildcards that are sort of mappable to Java, but not to C#. This could likely go on for much longer…
–jeroen






thaddy said
Actually, you are wrong here. You only demonstrate your futile – with respect, you know I respect you – efforts but not any proof that xsd can not describe any language (Karl Popper).
That proof is rather easy: since you can have lowercase and uppercase you can describe any case, you just did not succeed in doing that. It is important to realize that.
jpluimers said
I need to think about that a bit more. Hopefully my brain will allow that after surgery next week.