recursive schema: see a problem?

KJ

Usenet Archive
Joined
Feb 23, 2000
Messages
2,175
Reaction score
0
Hello,

I am trying to define a recursive element in this schema. Is there an error with the following:

<xs:complexType name="SystemType">
<xs:sequence maxOccurs="unbounded">
<xs:choice maxOccurs="unbounded">
<xs:element minOccurs="0" maxOccurs="unbounded"
name="SubSystem">
<xs:complexType>
<xs:sequence>
<xs:element ref="Operation" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="SubSystem" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute ref="SubSystemId" /> <xs:attribute ref="SystemId" /> </xs:complexType> </xs:element> <xs:element ref="Operation" /> </xs:choice> </xs:sequence> <xs:attribute ref="SystemId" /> <xs:attribute ref="Name" /> </xs:complexType>

-KJ
 

Henry S. Thompson

Usenet Archive
Joined
Jan 14, 2000
Messages
309
Reaction score
0
KJ said:
I am trying to define a recursive element in this schema. Is there an error with the following:

<xs:complexType name="SystemType"> . . .
<xs:element minOccurs="0" maxOccurs="unbounded" name="SubSystem"> <xs:complexType> <xs:sequence> . . . <xs:element ref="SubSystem" minOccurs="0" maxOccurs="unbounded"/>

Won't work -- you can only refer to elements declared at the top level.

Move the declaration of SubSystem up to the top level, replacing it within SystemType by <xs:element ref="SubSystem" minOccurs="0" maxOccurs="unbounded"/>

ht
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,050
Messages
3,104,249
Members
248,133
Latest member
DujonT

Latest Threads

Top