[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, 22 Sep 2000 12:18:04 -0600

xml schema equiv class
Namespaces should be explicit, at least, when each namespace is describes a different domain.  For example, if I build a camera namespace and need to have hypertext embedded at certain locations, the
best approach is to import the standard XHTML namespace and use qualified XHTML elements for example <xhtml:p> for paragraph.  This allows existing XHTML processing code to work on the embedded XHTML.

If a distinct, but semantically similar "Camera Hypertext Markup Language" was created, existing XHTML processing code would have to be modified to recognize <camera:p> as being identical in semantics
to <xhtml:p>.

The example you contrived has multiple namespaces that cover at closely related information, hence the impetus to unify these in the instance document vs in the schema.

A much better design would be for the camera namespace to declare the framework for the document and individual vendor namespaces to be used for vendor-specific information.  For example:

<camera xmlns="http://www.example.com/camera">
	<lens>
		<fubar:lens xmlns:fubar="http://www.fubar.com/camera" partNo="fb10204" inspector="#3454"/>
		<zoom>10x6</zoom>
	</lens>
	<body>
		<zeon:body xmlns:zeon="http://www.zeon.com/camera" material="titanium"/>
		<width>5</width>
		<height>7</height>
	</body>
</camera>

The camera namespace can be declare to allow elements from outside namespaces using the <xsd:any> particle or equiv classes could be used (for example, fubar:lens could be in the camera:vendorLens
equiv class).


----------------

[Interestingly, for the video-game schema I don't
see how to make geometry, lighting, and voice global.  Any thoughts?]

They are only global (and only accessible from other namespaces) if they appear at the top level in the imported schemas.

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.