- From: Jeni Tennison <jeni@jenitennison.com>
- Date: Tue, 27 May 2003 17:12:37 +0100
- To: "Paul Kiel" <paul@hr-xml.org>
- CC: xmlschema-dev@w3.org
Hi Paul, > The element "Parent" is defined as an element-only content > consisting of the child element "Child". The "Child" element is > optional. > > Example instance 1: > <Parent> > <Child/> > </Parent> > > Example instance 2: > <Parent> > </Parent> > > I know that Example instance # 1 is valid - and all parsers agree. > The whitespace in between the end of the openning <Parent> and the > beginning of the <Child> element (a line break and a few spaces) is > ignorable. > > On Example instance # 2, there is one parser that says the white > space is significant, and therefore not valid. Most of the parsers > say it is valid. Is the whitespace in Example 2 significant? Does it > prevent validation? (even though it is the same whitespace that is > in Example 1). Example instance # 2 is valid. In this case you have elementOnly content; the schema spec says: "If the {content type} is element-only [sic], 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)]." It is only when the content type is actually empty (i.e. you're not allowed any content at all in the element) that whitespace is significant. For example, if <Parent> were declared with: <xs:element name="Parent"> <xs:complexType /> </xs:element> then it wouldn't be legal for the <Parent> element to contain whitespace. So you've discovered a bug in one of the validators and should report it. Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/
Received on Tuesday, 27 May 2003 12:12:47 UTC