Element definition without a predefined element name?

I’ve been reading through the specs. And I can’t seem to find the answer
to my problem. I want to define a schema that validates an XML document
containing the following construct:
 
<someelement attr1=”value”>
          <child1>
                   <class>some.class.Test1</class>
                   <process>process_description</process>
          </child1>
          <child2>
                   <class>some.class.Test1</class>
                   <process>process_description</process>
          </child>
</someelement>
 
Looks trivial, but here’s the catch. I don’t want to define the names
child1, child2 etc. in the schema, but I need them to be of a certain
complexType. In short: How do I define <someelement> to contain a
sequence of children, with arbitrary names, but of a fixed complexType?
I know that I can get close by allowing the following:
 
<someelement attr1=”value”>
          <child name=”child1”>
                   <class>some.class.Test1</class>
                   <process>process_description</process>
          </child>
          <child name=”child2”>
                   <class>some.class.Test1</class>
                   <process>process_description</process>
          </child>
</someelement>
 
But this does not fit the requirements of my project.
 
Kind Regards,
 
Rune Bjørnstad.
 <mailto:r.p.bjornstad@student.utwente.nl>
r.p.bjornstad@student.utwente.nl
 
 

Received on Saturday, 9 November 2002 03:43:38 UTC