xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "K.C. Jones" <kjo...@phoenix-pop.com>
Subject Re: Attribute and Element
Date Fri, 19 May 2000 00:30:47 GMT
Interesting discussion with lots of helpful tips and points
to consider -- even if it is off-topic.

Anyway, I'm beginning to understand that there are simply no
hard and fast rules here.  Consider SVG.  SVG encodes vector
path information like:
	<path d="M316.32 120.153l11.443 12.706" style="&st2;"/>
Where the 'd' attribute encodes the pen movement somehow.
Lots of learned XML-DEV experts had a cow about how long the
attributes were (the example is a very small one), how
unparsable and un XSLT-transformable the important path data
was.  But the ruling requirement for SVG was compactness and
speed.  I think they were right.

So bear in mind that attributes can be long if need be.  And
that the structure and relationships that come with entity
hierarchies come with some performance and efficiency costs
when compared to use of attributes.

Cheers,
KC


mdelagra@us.britannica.com wrote:
> 
> Also, if you're XML document needs to be high performance, attributes are
> much more efficient.  The main drawback of an attribute is that it is a
> simple string; it should never be long, and it can never contain elements.
> If you think you may reuse the concept of "Price" in other contexts or want
> to assign child elements, it makes more sense to define it as an element.

Mime
View raw message