Hi Folks, This XML Schema declares an element with a content model that is a simple type:
<xs:element name="Test1"> In an XML instance document, the value of <Test1> can be 0, 1, …, 9. The content model of Test1 denotes this set: {0, 1, …, 9} Now consider this XML Schema, it declares an element with a content model that is a complex type with an empty sequence:
<xs:element name="Test2"> Lastly, consider this XML Schema, it declares an element with a content model that is a complex type that is an empty choice:
Michael Sperberg-McQueen wrote an article [1] which says that a content model which is an empty sequence denotes a set with an empty string, { å }. So the value of <Test2> must be a string of length zero. Here’s how
a string of length zero is physically expressed in an XML instance document:
MSM says that a content model that is an empty choice denotes an empty set, {}. That puzzled me, so I created an XML instance document containing <Test3>:
and validated it against the schema. It validated! Okay, I’m confused. In an XML instance document, does an empty element denote that the element’s value is
å (the empty string, i.e., a string of length zero), or does an empty element denote that the element has no value, i.e., the set of allowable values is the empty set? Can you give a concrete example that illustrates how Test2’s content is different than Test3’s content? /Roger [1] http://conferences.idealliance.org/extreme/html/2005/SperbergMcQueen01/EML2005SperbergMcQueen01.html#id2624489 |