OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Dilemma: dot notation or attribute

[ Lists Home | Date Index | Thread Index ]
  • To: xml-dev@lists.xml.org, XML-L@LISTSERV.HEANET.IE
  • Subject: Dilemma: dot notation or attribute
  • From: Autumn Cuellar <a.cuellar@auckland.ac.nz>
  • Date: Mon, 23 Sep 2002 17:16:29 +1200
  • Newsgroups: comp.text.xml
  • Organization: Bioengineering Research Group, University of Auckland
  • User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2a) Gecko/20020910

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





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS