[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] More on namespaces...
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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|