- From: <noah_mendelsohn@us.ibm.com>
- Date: Thu, 6 Dec 2001 12:34:26 -0500
- To: Jeni Tennison <jeni@jenitennison.com>
- Cc: Stanley.Guan@oracle.com, xmlschema-dev@w3.org
- Message-ID: <OF130A55B4.8A762F56-ON85256B1A.0060F301@lotus.com>
Jeni Tennison writes: >> As I understand it, elements with ANY content >> can have *any* content, *including* text content. No, I certainly don't think so. Acceptance of text content is controlled by mixed/element-only, which is checked before you even look at the content model. See [1] which says: Validation Rule: Element Locally Valid (Complex Type) For an element information item to be locally ˇvalidˇ with respect to a complex type definition all of the following must be true: 1 {abstract} is false. 2 If clause 3.2 of Element Locally Valid (Element) (§3.3.4) did not apply, then the appropriate case among the following must be true: 2.1 If the {content type} is empty, then the element information item has no character or element information item [children]. 2.2 If the {content type} is a simple type definition, then the element information item has no element information item [children], and the ˇnormalized valueˇ of the element information item is ˇvalidˇ with respect to that simple type definition as defined by String Valid (§3.14.4). 2.3 If the {content type} is element-only, then the element information item has no character information item [children] other than those whose [character code] is defined as a white space in [XML 1.0 (Second Edition)]. 2.4 If the {content type} is element-only or mixed, then the sequence of the element information item's element information item [children], if any, taken in order, is ˇvalidˇ with respect to the {content type}'s particle, as defined in Element Sequence Locally Valid (Particle) (§3.9.4). I think that 2.3 tells you that, regardless of whether there is <any> in the content model, text content is rejected if the type is element-only. Validation of element content proceeds after that check. The general philiosphy is that mixed/element-only is a switch that's completely orthogonal to the actual declared content model. [1] http://www.w3.org/TR/xmlschema-1/#cvc-complex-type ------------------------------------------------------------------------ Noah Mendelsohn Voice: 1-617-693-4036 Lotus Development Corp. Fax: 1-617-693-8676 One Rogers Street Cambridge, MA 02142 ------------------------------------------------------------------------
Received on Thursday, 6 December 2001 12:46:29 UTC