xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: Attribute and Element
Date Fri, 19 May 2000 10:33:35 GMT
"K.C. Jones" wrote:
> 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.  

You are right. Many believe that element vs. attribute is a religious
issue, not much different from browser wars, editor wars or os wars.

> 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.

I don't.

People believe that XML is verbose and will load their bandwidth. This
is the _totally_ wrong. In fact, it can be proved (based on pure
information theory) that XML conveys more structured information, then,
if the schema is a available at both ends, a schema-aware compressor is
able to compress the XML entropy stream with _LESS_ bits than an
equivalent xml-unaware compressor.

The XMill people showed they achieve 5% more compression over BZip by
simply using the XML syntax... they didn't even had to go down to

But they achieve this compression over the compressed text and I totally
agree that a pure binary vector format (with a tuned-for compressor)
would blow XML by an order of magnitude (like binary VRML showed).

So binary is always smaller than text-encoded formats, but the point is
XML verbosity and this doesn't count if a good compressor is used.

Unfortunately, very few understand XML verbosity is, from an information
point of view, fake.

> 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.

The use of entities is a form of compression and everyone knows that
doing compression over compression is not a good thing to do.

The SVG people clearly failed to understand the basics of network
layering and compression.

Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------

View raw message