Content v. attribute

Paul Prescod papresco at technologist.com
Tue Oct 27 05:40:11 GMT 1998


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"

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list