I've tracked the problem down to erlsom_pass2:pass3Alternative function, which attempts to add types to disambiguate between alternatives with the same base type. Unfortunately, it fails to account for derived types that might occur.
I see no easy fix for this. I've come up with 2 solutions so far:
Quick'n'dirty way: modify pass3Alternative to clone the whole hierarchy. Modify subtype checking to search for subtypes also within specified type clones (in this case, they'd be named something like "column-a-BaseType" and "column-a-DerivedType" etc, I guess).
More proper way: make the function produce a "wrapper type" of some sort that would have one element with one alternative, and some sort of flag that tells the scanner to immediately descend into that element. In HRL files, such types would be translated to 1-record fields, ie 2-tuples: a bit finnicky, but very workable.
I'd love to hear your opinions on this rather convoluted corner case.
Given the following XSD:
The following XML:
fails to parse, even though it ought.
I've tracked the problem down to erlsom_pass2:pass3Alternative function, which attempts to add types to disambiguate between alternatives with the same base type. Unfortunately, it fails to account for derived types that might occur.
I see no easy fix for this. I've come up with 2 solutions so far:
I'd love to hear your opinions on this rather convoluted corner case.