[alicebot-archcomm] Attributes vs Elements

Manos Batsis alicebot-archcomm@alice.sunlitsurf.com
Wed, 3 Jul 2002 16:39:09 +0300


> From: Dr. Richard S. Wallace [mailto:drwallace@alicebot.org] 

> In this context, it is intertesting to consider how various 
> proposals for
> attributes vs. elements map between XML notation and 
> S-expression notation.
> Perhaps the best choices are the ones that look nice in both forms.
> 
> I am fond of saying AIML is platform-independent and 
> language-independent.
> I wonder if it can be made syntax-independent too?

This reminds me of RDF. The model (graph) behind RDF is one; however
people feel free to use XML or n3 (or whatever comes close) as the
serialization format. 

We have a well defined model behind AIML and know-how on formal
syntactical rules such as XML. It should be relatively easy to lay
different syntax layers over the AIML model and make sure all approaches
have the same abilities so that one syntax can be perfectly mapped to
another. 

An example of this approach that works much better (or rather, is much
more stable) than RDF is Relax NG; the non-xml serialization is
author-friendly, while the xml syntax is good for building tools.

Cheers,

Manos





> 
> Rich
> 
> 
> ----- Original Message -----
> From: "Manos Batsis" <m.batsis@bsnet.gr>
> To: <A.Teal@hud.ac.uk>; <alicebot-archcomm@alice.sunlitsurf.com>
> Sent: Wednesday, July 03, 2002 2:39 AM
> Subject: RE: [alicebot-archcomm] Attributes vs Elements
> 
> 
> >
> > > From: Andrew Teal [mailto:A.Teal@hud.ac.uk]
> >
> > > <category>
> > > <pattern>COMPAREVARIABLES *  *</pattern>
> > > <template>
> > > <condition name="<star/>">
> > > <li value="<get name="<star index="2"/>"/>">Same value!</li>
> > > <li>Different values!</li>
> > > </condition></template>
> > > </category>
> > >
> > > Again that's logically what I want to do, but it's even 'more
> > > illegal'   :-)
> > > than Christopher's example!
> >
> > Yes. It makes AIML difficult to handle. Even when we change the
> > problematic line to
> >
> > <li value="<get name="&lt;star index='2'/&gt;"/>">Same value!</li>
> >
> > using entities and proper quoting, the AIML is still 
> unfriendly to XML
> > related technology; it's a matter of XML design. For 
> example, I've been
> > working on a DHTML based XML editor that uses XSLT to 
> translate any XML
> > to a grid (for visual editing). Any XSLT processor will replace the
> > entities to what they represent, making the above AIML invalid.
> >
> >
> > > <category>
> > > <pattern>COMPAREVARIABLES *  *</pattern>
> > > <template>
> > > <condition><name><star/></name>
> > > <li><value><get><name><star index="2"/></name></get></value>Same
> > > value!</li>
> > > <li>Different values!</li>
> > > </condition>
> > > </template></category>
> > >
> > > ... would be fine (though the tag names may need
> > > clarifying!).
> >
> > Agreed.
> >
> >
> > > McLaughlin
> > > says (Java & XML) "... a good rule of thumb: use elements for
> > > multiple-valued data and attributes for single-valued data."
> > > Does that apply
> > > in these contexts?
> >
> > I would add that attributes are definitely not suitable for 
> holding any
> > "representation of markup" with the exception of QNames.
> >
> >
> > > Are the problems severe enough to justify proposing a change?
> >
> > I would second such a proposal at once. If you need help with the
> > details feel free to knock.
> >
> > Kindest regards,
> >
> > Manos
> >
> > _______________________________________________
> > alicebot-archcomm mailing list
> > alicebot-archcomm@alice.sunlitsurf.com
> > http://alice.sunlitsurf.com/mailman/listinfo/alicebot-archcomm
> 
> _______________________________________________
> alicebot-archcomm mailing list
> alicebot-archcomm@alice.sunlitsurf.com
> http://alice.sunlitsurf.com/mailman/listinfo/alicebot-archcomm
>