A
Arndt Jonasson
I have a schema defining the input of a particular application. Let's
refer to the namespace for my schema by the prefix "my:". Now the need
has arisen to annotate such input documents with foreign attributes
and tags (which my application is to ignore). I see no problems with
attributes, but there are many ways to do it for elements.
One way is to use xs:any at the end of every complexType, thereby
allowing foreign elements at the end.
Another is to introduce a new element <my:appinfo> similar to
<xs:appinfo>, letting any foreign elements appear within it, but
forcing the <my:appinfo> element to be at the beginning of my
complexTypes, where I already have a <my:description>.
A third is to extend <my:description> to accept not only text, as
today, but arbitrary foreign elements.
A fourth way would be to put <xs:any ... maxOccurs="unbounded">
between all children in my complexType, allowing foreign elements
everywhere.
How is this usually done? Is there a best way? (I want minimum impact
on my own schema, and maximum usability for the user, and those two
goals of course are in conflict.)
/Arndt Jonasson
refer to the namespace for my schema by the prefix "my:". Now the need
has arisen to annotate such input documents with foreign attributes
and tags (which my application is to ignore). I see no problems with
attributes, but there are many ways to do it for elements.
One way is to use xs:any at the end of every complexType, thereby
allowing foreign elements at the end.
Another is to introduce a new element <my:appinfo> similar to
<xs:appinfo>, letting any foreign elements appear within it, but
forcing the <my:appinfo> element to be at the beginning of my
complexTypes, where I already have a <my:description>.
A third is to extend <my:description> to accept not only text, as
today, but arbitrary foreign elements.
A fourth way would be to put <xs:any ... maxOccurs="unbounded">
between all children in my complexType, allowing foreign elements
everywhere.
How is this usually done? Is there a best way? (I want minimum impact
on my own schema, and maximum usability for the user, and those two
goals of course are in conflict.)
/Arndt Jonasson