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

RE: Dilemma: dot notation or attribute

  • To: "Autumn Cuellar" <a.cuellar@a...>
  • Subject: RE: Dilemma: dot notation or attribute
  • From: "Dare Obasanjo" <dareo@m...>
  • Date: Sun, 22 Sep 2002 22:49:55 -0700
  • Cc: <xml-dev@l...>
  • Thread-index: AcJiwlOBhYmPG0Y7Q6+KEkq/WkOREwAADPO0
  • Thread-topic: Dilemma: dot notation or attribute

dot notation
>       Neither method is exactly XML-happy.  You expect the attribute value to
>       be a literal value with no hidden meaning for a processor to detect, as
>       would be necessary with the dot notation.  
This is the ideal case but isn't true in most XML applications including W3C technologies such as XSLT,W3C XML Schema and WSDL. This is due to the practice of embedding qualified names (QNames) in attribute values. In your example I would do 
 <model xmlns:example="http://www.example.com/sample_model.xml <http://www.example.com/sample_model.xml> " >
          <import_model name="example"
               uri="http://www.example.com/sample_model.xml <http://www.example.com/sample_model.xml> " />
          <variable name="A" units="example:meter_per_cm2"/>

PS: A good overview of XML namespaces is provided at http://www.jclark.com/xml/xmlns.htm
PPS: A more in depth overview is available at http://msdn.microsoft.com/library/en-us/dnexxml/html/xml05202002.asp

	-----Original Message----- 
	From: Autumn Cuellar [mailto:a.cuellar@a...] 
	Sent: Sun 9/22/2002 10:30 PM 
	To: Dare Obasanjo 
	Cc: xml-dev@l...; XML-L@L... 
	Subject: Re:  Dilemma: dot notation or attribute

	Would you mind providing an example?  I'm afraid I don't follow.
	Dare Obasanjo wrote:
	> Why don't you use namespaces? This seems to be exactly what they were designed for.
	>       -----Original Message-----
	>       From: Autumn Cuellar [mailto:a.cuellar@a...]
	>       Sent: Sun 9/22/2002 10:16 PM
	>       To: xml-dev@l...; XML-L@L...
	>       Cc:
	>       Subject:  Dilemma: dot notation or attribute
	>       Hello,
	>       I'll try to explain my dilemma as briefly as possible and maybe you
	>       could offer suggestions.  I want to be able to import one document with
	>       the root element <model> into another document with the same root
	>       element and then access element content in the imported "model".  We've
	>       considered two ways of doing this.
	>       The dot notation method:
	>       <model>
	>          <import_model name="example"
	>               uri="http://www.example.com/sample_model.xml" />
	>          <variable name="A" units="example.meter_per_cm2"/>
	>       </model>
	>       The above method effectively aliases "example" to the sample model uri,
	>       and then the variable can reference units defined in another model by
	>       listing the model nickname and the units separated by a dot.
	>       The attribute method:
	>       <model>
	>          <import_model name="example"
	>               uri="http://www.example.com/sample_model.xml" />
	>          <variable name="A" units="meter_per_cm2" units_model="example" />
	>       <model>
	>       The attribute method is similar, however, the imported model is
	>       referenced via a specific attribute.
	>       Neither method is exactly XML-happy.  You expect the attribute value to
	>       be a literal value with no hidden meaning for a processor to detect, as
	>       would be necessary with the dot notation.  However, there have been
	>       instances where groups give certain meaning to parts of an attribute
	>       value.  XML Schema uses the xsd: namespace prefix in attribute values to
	>       indicate that data types have already been defined by the XML Schema
	>       language.  And the attribute method bothers me because the "units_model"
	>       attribute is qualifying another attribute instead of the element it's
	>       placed on.  I've never seen another XML language do this before.  Does
	>       anyone know of a standard case in which an attribute describes another
	>       attribute?
	>       Do you have a preference of one method over the other, and why?  Can you
	>       think of another approach that I've missed?
	>       Thanks for your time!
	>       --
	>       Autumn A. Cuellar
	>       Bioengineering Institute
	>       The University of Auckland
	>       New Zealand
	>       -----------------------------------------------------------------
	>       The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
	>       initiative of OASIS <http://www.oasis-open.org>
	>       The list archives are at http://lists.xml.org/archives/xml-dev/
	>       To subscribe or unsubscribe from this list use the subscription
	>       manager: <http://lists.xml.org/ob/adm.pl>


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.
First Name
Last Name
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.