Re: Mixed contet

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 UTC