From: Will Hartung
Subject: Re: Insanity
Date: 
Message-ID: <2gv0t2F7892aU1@uni-berlin.de>
"Stefan Ram" <···@zedat.fu-berlin.de> wrote in message
···············@ram.dialup.fu-berlin.de...
> Frederic Brunel <···············@in-fusio.com> writes:
> >Again, a topic about XML vs S-expr and Code vs Data. Yes, I know that
> >I post a lot regarding this topic but I'm always fascinated by these
> >guys. They're really full of courage. (...)
>
>   For your amusement, here is Unotal:
>
> http://www.purl.org/stefan_ram/pub/unotal_en
>
>   The page also has a link to another page with a comparison
>   between Unotal and S-expressions. Comments are welcome.

The interesting complaint here is that S-expressions don't have a standard
way to represent attributes.

What's amusing is that semantically, there's really no difference between an
attribute and a child element, they're basically identical.

*sigh*

Regards,

Will Hartung
(·····@msoft.com)

From: Christopher C. Stacy
Subject: Re: Insanity
Date: 
Message-ID: <ufz9xyxfq.fsf@news.dtpq.com>
>>>>> On 18 May 2004 22:33:08 GMT, Stefan Ram ("Stefan") writes:
 >  "Will Hartung" <·····@msoft.com> writes:
 Will>> What's amusing is that semantically, there's really no
 Will>> difference between an attribute and a child element, they're
 Will>> basically identical.

 Stefan>   In XML, there is no standard semantics for attributes or
 Stefan>   child elements. So one can not make assertions about whether
 Stefan>   or not they are "semantically basically identical". You are
 Stefan>   free to specify XML-applications, where this is true. It is
 Stefan>   possible to specify XML-applications, where it is not true.

Are you sure about that?  I have always thought they you are not
allowed to specify that it's not true, because attributes are nothing
more than an alternate syntax (that may or may not be available) for
specifying (unordered, unstructured, single occurance, atomic)
elements of the enclosing element (or start tag).

In other words, 
if your DTD allows   <A HREF="foo"></A>
and also allows      <A><HREF>foo</HREF></A>
then they must necessarily mean the same thing, because only the NAME
of the element or attribute carries semantics to the application --
not the syntax of whether the name appeared as an attribute or element.

The application (eg. DTD) can define whether the element is allowed as
an attribute at all, but there's no way to define that it would mean
something different from a child element of the same name.  Since the
space of attribute names is the same as the space of element names,
and they are both logically associated with an enclosing element,
they must both mean the same thing.

But I can't find any specific reference to support my belief, so maybe
I'm just out to lunch with this.  Maybe someone who is an XML lawyer
can explain this (whether it's true or false) and give references to
the specs, so we can all be enlightened on this point.
From: Bill Clementson
Subject: Re: Insanity
Date: 
Message-ID: <1b3ac8a3.0405191038.7a027532@posting.google.com>
······@news.dtpq.com (Christopher C. Stacy) writes:

> How do you write a DTD in which there is an attribute name "FOO"
> for an element "ABOVE", where there can also be "FOO" elements
> inside "ABOVE" elements, and not have "FOO" mean the same thing
> in both places?   (I'm just looking at the XML 1.0 spec.)

Unless I misunderstood your question, doesn't the following DTD meet
the requirements you laid out above:

<?xml version='1.0' encoding='UTF-8' ?>
 <!ELEMENT above (foo)>
<!ATTLIST above  foo CDATA  #IMPLIED >
<!ELEMENT foo (#PCDATA)>

XML conforming to this DTD would be:

<?xml version="1.0"?>
<!DOCTYPE above SYSTEM "foo.dtd">
<above foo="attribute foo">
    <foo>element foo</foo>
</above>

In this example, the attribute "foo" = "attribute foo" and the element
"foo" = "element foo".

--
Bill Clementson
From: Christopher C. Stacy
Subject: Re: Insanity
Date: 
Message-ID: <uy8nodur0.fsf@news.dtpq.com>
>>>>> On 19 May 2004 11:38:57 -0700, Bill Clementson ("Bill") writes:

 Bill> ······@news.dtpq.com (Christopher C. Stacy) writes:
 >> How do you write a DTD in which there is an attribute name "FOO"
 >> for an element "ABOVE", where there can also be "FOO" elements
 >> inside "ABOVE" elements, and not have "FOO" mean the same thing
 >> in both places?   (I'm just looking at the XML 1.0 spec.)

 Bill> Unless I misunderstood your question, doesn't the following DTD meet
 Bill> the requirements you laid out above:

 Bill> <?xml version='1.0' encoding='UTF-8' ?>
 Bill>  <!ELEMENT above (foo)>
 Bill> <!ATTLIST above  foo CDATA  #IMPLIED >
 Bill> <!ELEMENT foo (#PCDATA)>

 Bill> XML conforming to this DTD would be:

 Bill> <?xml version="1.0"?>
 Bill> <!DOCTYPE above SYSTEM "foo.dtd">
 Bill> <above foo="attribute foo">
 Bill>     <foo>element foo</foo>
 Bill> </above>

 Bill> In this example, the attribute "foo" = "attribute foo" and the element
 Bill> "foo" = "element foo".

And those two FOO things are taken to mean something entirely
different from each other?
From: Bill Clementson
Subject: Re: Insanity
Date: 
Message-ID: <1b3ac8a3.0405200754.4c195a11@posting.google.com>
······@news.dtpq.com (Christopher C. Stacy) wrote in message news:<·············@news.dtpq.com>...

> And those two FOO things are taken to mean something entirely
> different from each other?

yes
From: Christopher C. Stacy
Subject: Re: Insanity
Date: 
Message-ID: <u3c5wfl16.fsf@news.dtpq.com>
How do you write a DTD in which there is an attribute name "FOO"
for an element "ABOVE", where there can also be "FOO" elements
inside "ABOVE" elements, and not have "FOO" mean the same thing
in both places?   (I'm just looking at the XML 1.0 spec.)
From: Christopher C. Stacy
Subject: Re: Insanity
Date: 
Message-ID: <uy8nnixcq.fsf@news.dtpq.com>
OK, I believe you now.

(And I think I got my confused notion from some experience I had with XSLT.)
From: Tayssir John Gabbour
Subject: Re: Insanity
Date: 
Message-ID: <866764be.0405212142.1367794f@posting.google.com>
"Will Hartung" <·····@msoft.com> wrote in message news:<··············@uni-berlin.de>...
> The interesting complaint here is that S-expressions don't have a standard
> way to represent attributes.
> 
> What's amusing is that semantically, there's really no difference between an
> attribute and a child element, they're basically identical.

On a blog's forum, a Microsoftie told me that XAML supported an
alternate syntax where, if you didn't like using attributes, you could
use a child with a name like "parentname.attributename".

It is funny to consider that the Redmondians may help save the
world...