W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2001

Re: Mixed contet

From: Eric van der Vlist <vdv@dyomedea.com>
Date: Fri, 06 Jul 2001 13:34:01 +0200
Message-ID: <3B45A229.A2D6228@dyomedea.com>
To: Igancio Vera <nano@informatics.bangor.ac.uk>
Cc: xmlschema-dev@w3.org

Igancio Vera wrote:
> 
>  Id there any way to constraint the content of a mixed element. if you have
> mixed content you put the attribute mixed set to true and you can have this
> kind of structure. But if I want this mixed cintent is an integer or
> whatever.

The problem is more complex than it seems.

Imagine you have:

<foo>
	1
	<bar>2</bar>
	3
	<bar>5</bar>
	5
</foo>

If you say that foo is a mixed content element of type integer, what is
supposed to be an integer?

Each of the text nodes ("1", "3", "5") ?
The concatenation of the text nodes without the whitespaces ("135") ?
The string value of foo without the whitespaces  ("12345") ?
One of the above with the whitespaces ?

To avoid going into these details, W3C XML Schema that do not treat text
nodes by themselves has chosen to disallow any constraint on the value
of mixed content elements.

If you need these constraints, the answer is the usual one: add a
Schematron constraint to your W3C XML Schema or switch to another schema
language ;=) ...

Hope this helps.

Eric
> 
> thanks

-- 
See you at XTech in San Diego.
             http://conferences.oreillynet.com/cs/os2001/view/e_spkr/790
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
------------------------------------------------------------------------
Received on Friday, 6 July 2001 07:34:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:22 GMT