W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2004

Re: Which elements in mixed="true"?

From: George Cristian Bina <george@sync.ro>
Date: Thu, 19 Aug 2004 15:15:00 +0300
Message-ID: <412499C4.3060908@sync.ro>
To: Thomas Solbjør <thomas.solbjor@strath.ac.uk>
CC: xmlschema-dev@w3.org

Hi Thomas,

If the mixed attribute is true then the text nodes inside an element 
will be ignored when performing validation, the remaining element 
children will be checked against the content model. What elements may go 
inside an element is controlled by the content model for that element.

XML Schema provides support for wildcard models and you can control the 
validation using the processContents attribute.

For instance:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:element name="test">
		<xs:complexType mixed="true">
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:any processContents="skip"/>

will allow to have any elements and text inside the test element even if 
those elements are not declared in the the schema.

For more details about wildcards see 

Hope that helps,
George Cristian Bina
<oXygen/> XML Editor & XSLT Editor/Debugger

Thomas Solbjør wrote:
> Hi,
> Does the XML Instance document support elements within an element with:
> mixed="true"?
> I'm thinking about formatting elements such as "<b>", "<h1>" etc.
> Do these elements have to be declared in the Schema or are they natively
> supported through the "mixed" attribute?
> --
> Thomas
Received on Thursday, 19 August 2004 12:13:43 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:23 UTC