From: "björn lundin" <b.f.lundin@gmail.com>
Subject: Re: xml/ada dropping data when pre-defined entities are separated by space?
Date: Tue, 1 Feb 2011 01:49:13 -0800 (PST)
Date: 2011-02-01T01:49:13-08:00 [thread overview]
Message-ID: <007966e9-4cf4-4f91-ac54-99a3a34ff7ca@k16g2000vbq.googlegroups.com> (raw)
In-Reply-To: 782436de-8a75-450d-be79-1efe555c4f5e@u3g2000vbe.googlegroups.com
On 31 Jan, 15:56, Emmanuel Briot <briot.emman...@gmail.com> wrote:
> > I was just going to ask what makes xml/ada decide why a textnode is
> > sometimes split into several nodes. I see the pattern now, of course,
> > 'split on predefined entity' but why?
>
> Because XML/Ada tries to be as efficient as possible, and normalizing
> the document takes time that a lot of application have no need for. If
> indeed your application is only able to deal with normalized document
> (it really shouldn't, the XML standard is quite clear that a document
> is not necessarily normalized), then indeed you should call Normalize.
Ok. A colleauge of mine pointed me to
http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1312295772
which states :
"When a document is first made available via the DOM, there is only
one Text node for each block of text. Users may create adjacent Text
nodes that represent the contents of a given element without any
intervening markup, but should be aware that there is no way to
represent the separations between these nodes in XML or HTML, so they
will not (in general) persist between DOM editing sessions. The
normalize() method on Node merges any such adjacent Text objects into
a single node for each block of text."
Isn't this the case of the first sentence?
I parse the document, I do not edit it in any way,
I traverse it, and there are several childnodes instead of one.
Or how should 'When a document is first made available via the DOM'
be interpreted?
/Björn
next prev parent reply other threads:[~2011-02-01 9:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-27 10:06 xml/ada dropping data when pre-defined entities are separated by space? björn lundin
2011-01-27 11:12 ` Georg Bauhaus
2011-01-29 15:36 ` björn lundin
2011-01-29 17:13 ` Simon Wright
2011-01-29 21:49 ` björn lundin
2011-01-29 22:24 ` Simon Wright
2011-01-31 0:22 ` Georg Bauhaus
2011-01-31 8:04 ` björn lundin
2011-01-31 14:56 ` Emmanuel Briot
2011-01-31 20:17 ` björn lundin
2011-02-01 9:49 ` björn lundin [this message]
2011-02-01 18:24 ` Vadim Godunko
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox