OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   RE: XML Schemas: Best Practices

[ Lists Home | Date Index | Thread Index ]
  • From: "Arnold, Curt" <Curt.Arnold@hyprotech.com>
  • To: "'xml-dev@lists.xml.org'" <xml-dev@lists.xml.org>
  • Date: Fri, 03 Nov 2000 15:51:05 -0700

Of course that assume that everything that wants to process <car> also knows or can fetch every schema that it can be a part of.  It also makes tools like XSLT difficult to apply (you could match just
the local name, but that would false match a different <car> element).  

Yes, if you have access to the schema, then you can determine if a particular incorporated <car> element matches your expectation, but the benefit of having the unambiguous explicit globally unique
identification that explicit prefixing would provide seems to overwhelm any slight readability improvement.  

I would prefer to see in the XML document, for example, an explicit <xhtml:p> or <svg:group> element (with the appropriate prefix declaration) in the document, then having to check the schema to see
if the <p> or <group> element in this context is identical to an <xhtml:p> or <svg:group> element or is something totally different.

If I were writing the document by hand, having the processor be able to imply the namespace by dereferencing the schema might be of benefit, but is makes the job of interpreting the document more
complicated both for processors and humans.

p.s. You had mentioned earlier that using multiple namespaces requires you to have multiple entries in the xsi:schemaLocation attribute.  I had orginally though that and it was one of my major
concerns with the schema location mechanism.  However, Henry Thompson pointed out that if a xsi:schemaLocation hint loads a schema the defines multiple namespaces through use of imports, then the
other namespaces do not need entries in the xsi:schemaLocation.

See http://lists.w3.org/Archives/Public/www-xml-schema-comments/2000JulSep/0215.html and related messages.

For example, if I have an schema at http://www.example.org/schemas/auto.xsd with a target namespace of http://www.example.org/namespace/auto that imports an schema for
http://www.example.org/namespace/tires, then either of these should be sufficient to locate all the necessary schema info:

<tire xmlns="http://www.example.org/namespace/tires" xsi:schemaLocation="http://www.example.org/namespace/tires http://www.example.org/schemas/auto.xsd">
		<auto xmlns="http://www.example.org/namespace/auto">

<auto xmlns="http://www.example.org/namespace/auto" xsi:schemaLocation="http://www.example.org/namespace/auto http://www.example.org/schemas/auto.xsd">
		<tire xmlns="http://www.example.org/namespace/tires">


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS