[XML Schema] Content type of complex type definition with complex content

S

Stanimir Stamenkov

Validating this document <http://stanio.info/test_inst.xml> against the
specified schema <http://stanio.info/test_schema.xml> gives me no
errors.

I've wondered why the text content appearing inside the "test-elem" is
considered valid giving the following rules for determining the content
type said:
3.1 If the <restriction> alternative is chosen, then the
appropriate case among the following:
3.1.1 If the ·effective content· is empty , then empty;
3.1.2 otherwise a pair consisting of
3.1.2.1 mixed if the ·effective mixed· is true, otherwise
elementOnly
3.1.2.2 The ·effective content·.

So the ·effective content· of "TestType" is empty and not mixed (to
allow text content) thus resulting in empty content type. Am I missing
something?
 
H

Henry S. Thompson

Stanimir said:
So the ·effective content· of "TestType" is empty and not mixed (to
allow text content) thus resulting in empty content type. Am I missing
something?

The ·effective content· of TestType is not empty, it's a synthetic
empty sequence -- see clause 2.1 immediately above the bit you quote
here (in the 2nd edition [1] -- this was a bug in the first edition).

This gives the behaviour you observe, which is surely what is wanted.

ht

[1] http://www.w3.org/TR/xmlschema-1/#key-efm
--
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]
 
S

Stanimir Stamenkov

Henry said:
The ·effective content· of TestType is not empty, it's a synthetic
empty sequence -- see clause 2.1 immediately above the bit you quote
here (in the 2nd edition [1] -- this was a bug in the first edition).

This gives the behaviour you observe, which is surely what is wanted.

[1] http://www.w3.org/TR/xmlschema-1/#key-efm

Thank you. I've always interpreted it should be that way but for some
reason I've missed to complete the whole 2.1 clause now and predicted
wrong result.
 

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,254
Members
46,850
Latest member
VMRKlaus8

Latest Threads

Top