This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes XML and Related Technologies and the fly likes Recursive tags in xsd Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Recursive tags in xsd" Watch "Recursive tags in xsd" New topic

Recursive tags in xsd

chets patel
Ranch Hand

Joined: Apr 27, 2010
Posts: 74

I am trying to create xsd having recursive tag as shown below.

I googled a lot...and It seems that above tag is correct.
But when I validate my xml with xsd...its giving error "The content of element 'Member' is not complete. One of '{Member}' is expected."

Please suggest asap as it is very urgent
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
Don't try to create a markup structure this way. Use unique element names. What you are attempting to do here, and if you succeed, will create an overly complex and uneccessary burden on the programs that process the XML instance.
chets patel
Ranch Hand

Joined: Apr 27, 2010
Posts: 74

But I have created the whole application and its working fine...for recursive element it was easy to parse as I wrote the recursive function...
I have to create xsd for validation. I have no other option.
Please suggest solution.
Paul Clapham

Joined: Oct 14, 2005
Posts: 18541

Come on. I know nothing about Schema but when I googled just "xs:sequence" and read the first link, I found it has a "minOccurs" attribute whose default value is 1. And that, it seems to me, is precisely what the error message is saying. Your schema can't describe any XML document of finite size.

And yes, I agree with Jimmy Clark that a design with meaningless element names is usually not a good design.
wood burning stoves
subject: Recursive tags in xsd