[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XML Schemas: Best Practices

  • From: "Arnold, Curt" <Curt.Arnold@h...>
  • To: "'xml-dev@l...'" <xml-dev@l...>
  • Date: Fri, 03 Nov 2000 15:51:05 -0700

schemas auto
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">
	<mountedOn>
		<auto xmlns="http://www.example.org/namespace/auto">
		...
		</auto>
	</mountedOn>
</tire>


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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.