Help! Can't XML Schema do this?

I'm having trouble trying to create one small set of reusable .xsd
definitions that I can use to describe a lot of existing xml fragments that
follow the simple pattern shown below, without having to hard-code any
element names.  If I have to define a complex type for each such XML
fragment, and hard-code the element names for the contained child elements,
it forces me to replicate the same schema definitions many many times, even
though all the XML fragments have the exact same structure and follow the
same rules. They just have different element names. For example:

<Array1 mytype="array">
  <Array1Elem mytype="string">foo</Array1Elem>
  <Array1Elem mytype="string">bar</Array1Elem>
</Array1>

I have many occurrences of XML fragments like the one shown above. It is
infeasible to duplicate the schema code for each possible element name.  So
I just want to define some complex types where the actual element names can
vary.  All of the contained elements always have the same name and type.

Can this be done using abstract elements? Substitution groups? Some other
feature? Not at all?
 

Received on Monday, 24 February 2003 19:02:45 UTC