W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2002

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

From: Test1 <test1@w3.org>
Date: Mon, 4 Feb 2002 05:45:39 -0500 (EST)
To: <xmlschema-dev@w3.org>
Message-ID: <000001c1accc$bc108670$0100007f@brainware.ch>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:26 GMT