xsd schema choice for legacy unknown values

rmuwpmaeri

New Member
I'm trying to come up with a schema that allows xml to specify that an element is unknown for legacy reasons rather than just making the element non mandatory.For instance:\[code\]<personName>John</personName>\[/code\]is valid but\[code\]<personName></personName>\[/code\]is not valid but\[code\]<personName><legacyUnknown /></personName>\[/code\]is valid.And this should work regardless of the complexity of the element personName. Sometimes it might be a simpletype with a string restriction, other times it might be a complex element.\[code\]<choice> <element name="personName" type="name" /> <element name="personName" type="legacyUnknown" /></choice><simpleType name="name"><restriction base="string">...enum values</restriction></simpleType>\[/code\]Would be great but as far as I'm aware you can't do this. I know it could be done with a substitutiongroup but it seems to me like I would have to put the verbose code for building a sub group on every type that I want this to apply to.Any help on this would be greatly appreciated.
 
Back
Top