keyref constraint as part of type - impossible?

I

Ian Pilcher

I've managed to figure out how to create a keyref identity constraint as
part of an element definition in my schema. Ideally, I would like to
make it part of the type definition.

In my initial experiments, it doesn't look like this is possible. (I've
actually managed to add a constraint to an element within a complex
type, and the parser accepts it, but it doesn't appear to do anything.)

A little bit of reflection leads me to think that it's probably not
possible, because it doesn't really make sense. (How can a type be
constrained by an element?)

Am I right?

Thanks!
 
H

Henry S. Thompson

Ian said:
I've managed to figure out how to create a keyref identity constraint as
part of an element definition in my schema. Ideally, I would like to
make it part of the type definition.

Not possible. However, you may well find that you can elevate your
keyref to the declaration for the document element of your schema, if
the need for repetition on elements lower in the tree is what's
irritating you.

ht
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: (e-mail address removed)
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
 
I

Ian Pilcher

Henry said:
keyref to the declaration for the document element of your schema, if
the need for repetition on elements lower in the tree is what's
irritating you.

Thanks!
 

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
474,001
Messages
2,570,251
Members
46,850
Latest member
Brightrs

Latest Threads

Top