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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [SML] Whether to support Attribute or not?

[ Lists Home | Date Index | Thread Index ]
  • From: "Clark C. Evans" <clark.evans@manhattanproject.com>
  • To: Joe Lapp <jlapp@webmethods.com>
  • Date: Mon, 29 Nov 1999 05:35:18 -0500 (EST)



On Sun, 28 Nov 1999, Joe Lapp wrote:
> I understand the problem better after reading other people's responses.
> What threw me was the analogy to object data and behavior, which I don't
> think is the right analogy.

Yep.  data/behavior is not quite right.

To see this more clearly, I firmly believe
that before describing any XML model, the context 
or business purpose of the XML document must
be clearly aticulated.  Only with a fixed context
does the content vs attribute distinction make
itself clear -- different contexts have different
solutions.

Otherwise, it is much like a debate.  Here
the experienced debater first induces the 
opponent to make a statement X in a context A.
Then, he continues by slowly changing the context 
to B -- praying that the opponent does not notice 
the context switch.  Finally, she proceeds with 
a line of reasoning that eventually contradicts
assumptions in context A.  And, sure enough, 
the opponent's statement is contradicted
since it was not updated to reflect the new context.

> 
> In each of these example elements
> 
>   <lineitem><model>XYZ</model><quantity>3</quantity></lineitem>
>   <lineitem quantity="3"><model>XYZ</model></lineitem>
>   <lineitem quantity="3">XYZ</lineitem>
> 
> 'lineitem' has two properties: model and quantity.  It happens that in the
> last example the model is not labelled 'model'.  The label is missing,
> since strictly speaking XYZ is not the lineitem.

Context:  The user is reviewing an order form displayed as
          a grid on the screen.  The text shown to the
          user must be included in the XML file as well
          as the internal part numbers, etc. 

<order id="283382">
  <line id="28383" can-change="yes" unit-price="12.95" >
    <part model="XYZ">Rotor Blade, 3 inches</part>
    <quantity>3</quantity>
    <extended-price>$38.85</extended-price>
  </line>
  <line id="28384" can-change="no" >
    <part model="BBB" close-out="yes">DuchBoy Grass XL</part>   
    <quantity>1</quantity>
    <extended-price>$24.49</extended-price>
  </line>
  ...
</order>

In the above XML fragment, the information shown to the
user who is filling out the order is "content", and
information needed by the client application for proper
editing is "attributes".   Something like "can-change"
is a direct command... not to the shopper, but to
the shopping applicatoin, thus it is meta-information.

  Context:  A picker is going through a warehouse
            fulfilling an order; holding a wireless device.

<order id="283382" priority="2" >
  <cart>283382</cart>
  <pick-list>
    <item id="28384" >
      <bin>A23</bin>
      <part>BBB</part>
      <quantity>1</quantity>
    </item>
    ...
    <item id="28383">
      <bin>Z34</bin>
      <part>XYZ</part>
      <quantity>3</quantity>
    </item>
  </pick-list>
</order>

In this case, priority is a directive to the 
wiress device used to rank order fulfillment
list.  The ids are needed for a feedback-message
describing what was picked.  All other things
are displayed directly to the human doing the
picking.  Thus, there are two classes of information,
those directed at the device (priority/id) and
the remainder of the information directed to the
device's user.

I hope this makes sense.

> I'd argue that if an element has attributes in addition to text content,
> then the attributes together with the content define the element, and the
> content must therefore be yet one more property of the element.  The
> property simply has not been named.

This, I believe, is the InfoSet / Property Set perspective.
>From what I remember, the property un-named is called "content"
It does sound very resonable.

> You might consider that a shortcoming of XML.  By allowing attributes it
> allows elements to have unnamed properties. 
> I'm having troubl interpreting this as an advantage that attributes 
> give.  Were there never attributes, every property would have a label.
> (Unless there is  mixed content, which prompts my next thread...)
>
> I think the solution for SML/XML conversion is give this property an
> explicit name.

Hmm.  Sorry.  I didn't quite get it.

...

As a streach, lets use a form example.  The elements are
model the layout components.  Text content, means that the 
element shows that text to the user directly.   Sub-elmeents, 
mean that the component is a container and has children.  
Attributes are not shown to the user, they are only 
used to direct how the widget is displayed.

While the user interacts with the widgets, they
change the text content; however, the user does
not interact with the attributes.  Instead, the
attributes define how the user interacts with
the text content -- it is meta-data.

Hmm.  Oh well.

Clark


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)






 

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

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