Re: Content v. attribute

Paul Prescod (papresco@technologist.com)
Mon, 26 Oct 1998 23:27:18 -0500


Don Park wrote:
>
> String city = address.getAttribute("city")
> String street = address.getAttribute("street")
>
> or even simpler in ECMAScript:
>
> var city = address.city
> var street = address.street
>
> In other words, why not treat attributes as a specific type of child
> element: unique and childless?

Your example elements being treated as a special kind of *attribute*.
(getAttribute(...)). But how do you "attribute-ize" a content model like
this:

<!ELEMENT P (#PCDATA|EMPH|B|I|A)>

What does P.getAttribute( "B" ) return if there are three B s with four I
s between them?

Paul Prescod - http://itrc.uwaterloo.ca/~papresco

Marge: "It's almost as if Snake is killing from beyond the grave."
Lisa: "I warned you that capital punishment wouldn't be a deterrent."
- The Simpson's halloween special: "Hell Toupee"