- From: Martin Gudgin <marting@develop.com>
- Date: Sat, 19 Jan 2002 12:53:21 -0000
- To: "Jonathan Marsh" <jmarsh@microsoft.com>, <holstege@mathling.com>, <www-xml-xinclude-comments@w3.org>, "XML Core WG" <w3c-xml-core-wg@w3.org>
- Cc: <w3c-xml-schema-wg@w3.org>
----- Original Message ----- From: "Jonathan Marsh" <jmarsh@microsoft.com> To: <holstege@mathling.com>; <www-xml-xinclude-comments@w3.org>; "XML Core WG" <w3c-xml-core-wg@w3.org> Cc: <w3c-xml-schema-wg@w3.org> Sent: Saturday, January 19, 2002 1:09 AM Subject: RE: XML Schema WG Comments on XInclude > > -----Original Message----- > > From: Mary Holstege [mailto:holstege@mathling.com] > > Sent: Friday, January 18, 2002 11:06 AM > > Thanks for the schema suggestion. Only in the last week or so have I > begun using Schema-aware tools to create and validate schemas. > Hopefully this will reduce silly mistakes! > > If we don't decide to restrict the placement of extension elements, > would the following schema give us the constraint we want? (Zero or one > xi:fallback element child, no xi:include children, and anything else > including non-namespaced elements in any order.) Unfortunately this content model is non-deterministic in the case where the xi:fallback element does not appear. Also ##other does not allow unqualified elements. I think you'll have to go with; <xs:choice minOccurs='0' maxOccurs='unbounded' > <xs:element ref='xi:fallback' /> <xs:any namespace='##other' processContents='lax' /> <xs:any namespace='##local' processContents='lax' /> </xs:choice> as the content model for xi:include Regards Martin Gudgin DevelopMentor > > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:xi="http://www.w3.org/2001/XInclude" > targetNamespace="http://www.w3.org/2001/XInclude"> > > <xs:element name="include"> > <xs:complexType mixed="true"> > <xs:sequence> > <xs:choice minOccurs="0" maxOccurs="unbounded"> > <xs:any namespace="#other" processContents="lax"/> > </xs:choice> > <xs:element ref="xi:fallback" minOccurs="0"/> > <xs:choice minOccurs="0" maxOccurs="unbounded"> > <xs:any namespace="#other" processContents="lax"/> > </xs:choice> > </xs:sequence> > <xs:attribute name="href" type="xs:anyURI" use="required"/> > <xs:attribute name="parse" use="optional" default="xml"> > <xs:simpleType> > <xs:restriction base="xs:string"> > <xs:enumeration value="xml"/> > <xs:enumeration value="text"/> > </xs:restriction> > </xs:simpleType> > </xs:attribute> > <xs:attribute name="encoding" type="xs:string" use="optional"/> > <xs:anyAttribute namespace="##other" processContents="lax"/> > </xs:complexType> > </xs:element> > > <xs:element name="fallback"> > <xs:complexType mixed="true"> > <xs:choice minOccurs="0" maxOccurs="unbounded"> > <xs:element ref="xi:include"/> > <xs:any namespace="#other" processContents="lax"/> > </xs:choice> > <xs:anyAttribute /> > </xs:complexType> > </xs:element> > > </xs:schema> > > > The full schema: > > > > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > > xmlns:xi=http://www.w3.org/2001/XInclude > > targetNamespace="http://www.w3.org/2001/XInclude"> > > <xs:element name="include"> > > <xs:complexType mixed="true"> > > <xs:choice minOccurs="0" maxOccurs="unbounded"> > > <xs:element ref="xi:fallback"/> > > <xs:any namespace="#other" processContents="lax"/> > > </xs:choice> > > <xs:attribute name="href" type="xs:anyURI" use="required"/> > > <xs:attribute name="parse" use="optional" default="xml"> > > <xs:simpleType> > > <xs:restriction base="xs:string"> > > <xs:enumeration value="xml"/> > > <xs:enumeration value="text"/> > > </xs:restriction> > > </xs:simpleType> > > </xs:attribute> > > <xs:attribute name="encoding" type="xs:string" use="optional"/> > > <xs:anyAttribute namespace="##other" processContents="lax" /> > > </xs:complexType> > > </xs:element> > > > > <xs:element name="fallback"> > > <xs:complexType mixed="true"> > > <xs:choice minOccurs="0" maxOccurs="unbounded"> > > <xs:element ref="xi:include"/> > > <xs:any namespace="##other" processContents="lax"/> > > </xs:choice> > > <xs:anyAttribute namespace="##other" processContents="lax" /> > > </xs:complexType> > > </xs:element> > > </xs:schema> > > > > -- Mary Holstege > > for the XML Schema WG >
Received on Saturday, 19 January 2002 07:54:22 UTC