Re: reference to root element

Hi Rosa,

> I have this schema where the "Chapter" element inside "Book" refers
> back to "Book". The schema seems to be correct but, how can I have
> an instance where the "Book" element of "Chapter" always refers back
> to its root element itself?

I'm a bit confused about what you're after. The schema that you posted
with your message isn't valid (the element declaration for Chapter
contains a element declaration directly -- it should be nested within
a model group within a complex type). Also, as defined it looked as
though you had a Book element that must contain a Chapter element that
must contain a Book element that must contain a Chapter element and so
on, which means that it would be impossible to create an instance.

What do you mean by "refers back to"? Do you mean that the Book
element has an ID and the Chapter element must have an attribute or
element that has the same value as that ID? If so, then you can do
this with a key/keyref pair -- if you confirm that that's what you
want to do, we can show you how to do that.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

Received on Monday, 15 April 2002 06:40:01 UTC