Two elements FooFoo with different types in a sequence? Is this possible?

Hi XML Schema Gurus


I want do this:

<xsd:complexType name="Foo">

    <xsd:sequence>
         <xsd:element name="FooFoo" type="xsd:string"/>
         <xsd:element name="FooFoo" type="xsd:integer"/>
    </xsd:sequence>

</xsd:complexType>

Because I want to validate a xml like this:

<Foo>
    <FooFoo>xfoo</FooFoo>
    <FooFoo>12</FooFoo>
</Foo>

In detail I want to validate the number and content of the FooFoo elements.
The FooFoo element content type is(could be) different for each FooFoo
element
in the Foo element.

But it dosen't work...
Parsing error:  Schema error: duplicate element decl in the same scope with
different types : FooFoo.

Is there a way to do something like this with xsd?
Has some body a solution/ workaround for this probelm or ...?
Or a hint?

It's importend for me that the element name for an element in the element
Foo
is every time FooFoo. Because I wan't write an engine that validate, parses
different xml
files and write there data into a database. Therefore the element
structure(Names) should be
always the same. But it should be possible to write a xsd file for each
input xml file
to validate the number and content of the FooFoo elements.

Thanx a lot...

bye
michi

Received on Monday, 4 February 2002 05:49:38 UTC