Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > [XML Schema] Content type of complex type definition with complex content

Reply
Thread Tools

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

 
 
Stanimir Stamenkov
Guest
Posts: n/a
 
      10-24-2005
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

 
Reply With Quote
 
 
 
 
Henry S. Thompson
Guest
Posts: n/a
 
      10-25-2005
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: http://www.velocityreviews.com/forums/(E-Mail Removed)
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
 
Reply With Quote
 
 
 
 
Stanimir Stamenkov
Guest
Posts: n/a
 
      10-25-2005
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time template list definition / Run-time variable type definition Pierre Yves C++ 2 01-10-2008 02:52 PM
wsdl2java: method parameter a complex type that extends another complex type Robert Mark Bram Java 0 02-04-2007 10:06 AM
Automagic determination of definition based on definition location. Jon Slaughter C++ 4 10-26-2005 05:00 PM
can a class definition inside another class's definition Jianli Shen C++ 1 03-13-2005 06:02 PM
help?: incomplete definition with complete definition in scope Ark C Programming 1 08-07-2004 04:21 PM



Advertisments