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

More on namespaces...

  • To: "xml-dev" <xml-dev@l...>
  • Subject: More on namespaces...
  • From: "Seairth Jacobs" <seairth@s...>
  • Date: Mon, 9 Jun 2003 11:21:22 -0400

xmlns h
The whole xmlns thread has left me more confused about what should and
should not be done with namespaces...  so, can someone answer these
questions:


1) Suppose you have a vocabulary that states that only <B> may be within
<A>.  Now suppose you have another vocabulary with element <C>.  If one were
to do <ns1:A><ns1:B/><ns2:C/></ns1:A>, would the document still be valid
according to the first vocabulary?

2) Given the various levels of support for xml namespaces in tools, what
would be the pros/cons of the following practice:

The document's primary vocabulary is never namespaced.  Secondary
vocabularies are always namespaced.  Default namespacing is never used.  If
the primary vocabulary will also act in a secondary fashion (e.g.
"mustUnderstand" in SOAP), then it will be namespaced.  However, only
secondary uses of the vocabulary are qualified.  Primary uses are still not
namespaced.

3) In one of the original posts of the recent thread, there was a sample
document:

<h:html xmlns:xdc="http://www.xml.com/books"
        xmlns:h="http://www.w3.org/HTML/1998/html4">
 <h:head><h:title>Book Review</h:title></h:head>
 <h:body>
  <xdc:bookreview>
   <xdc:title>XML: A Primer</xdc:title>
   <h:table>
    <h:tr align="center">
     <h:td>Author</h:td><h:td>Price</h:td>
     <h:td>Pages</h:td><h:td>Date</h:td></h:tr>
    <h:tr align="left">
     <xdc:author><h:td>Simon St. Laurent</h:td></xdc:author>
     <xdc:price><h:td>31.98</h:td></xdc:price>
     <xdc:pages><h:td>352</h:td></xdc:pages>
     <xdc:date><h:td>1998/01</h:td></xdc:date>
    </h:tr>
   </h:table>
  </xdc:bookreview>
 </h:body>
</h:html>

I am wondering if the real problem here is the way in which the vocabularies
are being mixed.  For instance, would it possbily have been better to do
something like:

<h:html xmlns:xdc="http://www.xml.com/books"
        xmlns:h="http://www.w3.org/HTML/1998/html4">
 <h:head><h:title>Book Review</h:title></h:head>
 <h:body>
  <h:table>
   <h:tr align="center">
    <h:td>Author</h:td><h:td>Price</h:td>
    <h:td>Pages</h:td><h:td>Date</h:td></h:tr>
   <h:tr align="left">
    <h:td><h:span id="author">Simon St. Laurent</h:span></h:td>
    <h:td><h:span id="price">31.98</h:span></h:td>
    <h:td><h:span id="pages">352</h:span></h:td>
    <h:td><h:span id="date">1998/01</h:span></h:td>
   </h:tr>
  </h:table>
  <xdc:bookreview>
   <xdc:title>XML: A Primer</xdc:title>
   <xdc:author idref="author"/>
   <xdc:price idref="price"/>
   <xdc:pages idref="pages"/>
   <xdc:date idref="date"/>
  </xdc:bookreview>
 </h:body>
</h:html>

or maybe...

<h:html xmlns:xdc="http://www.xml.com/books"
        xmlns:h="http://www.w3.org/HTML/1998/html4">
 <h:head><h:title>Book Review</h:title></h:head>
 <h:body>
  <h:div xdc:field="bookreview">
   <h:span style="visiblity:none"
    xdc:field="title">XML: A Primer</h:span>
   <h:table>
    <h:tr align="center">
     <h:td>Author</h:td><h:td>Price</h:td>
     <h:td>Pages</h:td><h:td>Date</h:td></h:tr>
    <h:tr align="left">
     <h:td><span xdc:field="author">Simon St. Laurent</h:span></h:td>
     <h:td><h:span xdc:field="price">31.98</h:span></h:td>
     <h:td><h:span xdc:field="pages">352</h:span></h:td>
     <h:td><h:span xdc:field="date">1998/01</h:span></h:td>
    </h:tr>
   </h:table>
  </h:div>
 </h:body>
</h:html>

I'm not sure than any of these are any better or worse (though I admit I'm
not crazy about the id/idref version).  I guess the point is...  in the
original XML above, are we really trying to figure out how to separate the
vocabularies successfully, or are we really seeing a case where the design
is bad to start with? (I'm not saying the example was bad, just asking a
question.)

4) Should a vocabulary be able to dictate how other vocabularies can be used
with it?  I am talking about the general case where the specifics of a
secondary vocabulary are not known.  For instance, can a vocabulary state
that absolutely no elements, regardless of where they come from, may be
within element <x>?  Another way of looking at this question is:  should a
vocabulary explicitly state what is allowed for secondary vocabularies?  If
vocabulary does not define this, what should the "default" behaviour be?

---
Seairth Jacobs
seairth@s...


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.