- From: David Beech <David.Beech@oracle.com>
- Date: Mon, 18 Dec 2000 11:14:59 -0800
- To: "Henry S. Thompson" <ht@cogsci.ed.ac.uk>
- CC: "Falk, Alexander" <al@altova.com>, www-xml-schema-comments@w3.org
"Henry S. Thompson" wrote: > > Thanks for your detailed comments. Note for good public relations, > it's best not to send mail directly to both a public > (www-xml-schema-comments) and a member-only (w3c-xml-schema-ig) list > at the same time. > > I'll respond to a few things I think we could use some clarification > on or where I think you've perhaps misunderstood something: > > "Falk, Alexander" <al@altova.com> writes: > > > 1) the CR should perhaps expressedly inform the reader, that any schema > > document that uses a default namespace (ie no prefix) to refer to > > "http://www.w3.org/2000/10/XMLSchema" must have a targetNamespace - otherwise > > any type="..." or ref="..." can not be correctly attributed to either the > > built-in types of XML schema or the types that the user defines in his/her > > schema > > I'm not sure I understand. The following is perfectly valid: > > <schema xmlns="http://www.w3.org/2000/10/XMLSchema"> > <element name="foo"> > <sequence> > <element name="bar" type="integer"/> > <element name="baz" type="date"/> > </sequence> > </element> > </schema> > Yes, but the following is not: <schema xmlns="http://www.w3.org/2000/10/XMLSchema"> <element name="foo" type="fooType"/> <complexType name="fooType"> <sequence> <element name="bar" type="integer"/> <element name="baz" type="date"/> </sequence> </complexType> </schema> Of course, an explicit schema prefix works: <xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"> <xsd:element name="foo" type="fooType"/> <xsd:complexType name="fooType"> <xsd:sequence> <xsd:element name="bar" type="xsd:integer"/> <xsd:element name="baz" type="xsd:date"/> </xsd:sequence> </xsd:complexType> </xsd:schema> Although this style is heavier, it is always safe. It seems to have the additional advantage that XSLT can be applied to such schemas by using exactly the same prefixed element names to refer to them. Whereas if one has used default namespace declarations in the schemas, XSLT forces one to introduce prefixes and use them when referring to the elements that are unprefixed in the schemas. David
Received on Monday, 18 December 2000 14:18:03 UTC