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

Discussion in 'XML' started by Stanimir Stamenkov, Oct 24, 2005.

  1. 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
    Stanimir Stamenkov, Oct 24, 2005
    #1
    1. Advertising

  2. 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:
    URL: http://www.ltg.ed.ac.uk/~ht/
    [mail really from me _always_ has this .sig -- mail without it is forged spam]
    Henry S. Thompson, Oct 25, 2005
    #2
    1. Advertising

  3. 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
    Stanimir Stamenkov, Oct 25, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,497
    Markus
    Nov 23, 2005
  2. chobin
    Replies:
    0
    Views:
    422
    chobin
    Dec 10, 2003
  3. Abhinav
    Replies:
    6
    Views:
    1,056
    Abhinav
    Aug 16, 2004
  4. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,170
    Stanimir Stamenkov
    Apr 25, 2005
  5. Replies:
    3
    Views:
    2,788
Loading...

Share This Page