![]() |
[XML Schema] Content type of complex type definition with complex content
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 <http://www.w3.org/TR/xmlschema-1/#key-efm>: > 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? -- Stanimir |
Re: [XML Schema] Content type of complex type definition withcomplex content
Stanimir Stamenkov writes:
>> 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? 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: ht@inf.ed.ac.uk URL: http://www.ltg.ed.ac.uk/~ht/ [mail really from me _always_ has this .sig -- mail without it is forged spam] |
Re: Content type of complex type definition with complex content
Henry S. Thompson wrote:
> 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. -- Stanimir |
| All times are GMT. The time now is 01:55 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.