comp.lang.ada
 help / color / mirror / Atom feed
From: "björn lundin" <b.f.lundin@gmail.com>
Subject: Re: xml/ada dropping data when pre-defined entities are separated by space?
Date: Mon, 31 Jan 2011 00:04:57 -0800 (PST)
Date: 2011-01-31T00:04:57-08:00	[thread overview]
Message-ID: <c4e6eada-7ca3-4add-9aca-b6ca828ef73a@d21g2000vbf.googlegroups.com> (raw)
In-Reply-To: 4d4600c9$0$6880$9b4e6d93@newsspool2.arcor-online.net

On 31 Jan, 01:22, Georg Bauhaus <rm-host.bauh...@maps.futureapps.de>
wrote:
> On 1/29/11 10:49 PM, bj rn lundin wrote:
>
> > bnl@ubuntu-virtual:~$ ./test_xml
> > Value of Row is: ABC&
> > Value of node is: ABC&
> > Value of node is:&  DEF
>
> Does XML/Ada's Node have a Normalize op? (IIUC, normalize
> will merge adjacent Text nodes.)  Or does Document have
> a normalization op for the entire document, maybe?

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?

for Index in 1 .. Length (List) loop
  N := Item(List, Index - 1);
  cl:=child_nodes(N);
  Ada.Text_IO.Put_Line("Value of Row is: " &  Node_Value(First_Child
(N)));
  for i in 1 .. length(cl) loop
    Ada.Text_IO.Put_Line("Value of node is: " &
Node_Value(item(cl,i-1)));
  end loop;
end loop;

can be replaced with

for Index in 1 .. Length (List) loop
  N := Item(List, Index - 1);
  Normalize(N);
  Ada.Text_IO.Put_Line("Value of Row is: " &  Node_Value(First_Child
(N)));
end loop;

with the same result.
Thank you Simon and George




  reply	other threads:[~2011-01-31  8:04 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 [this message]
2011-01-31 14:56             ` Emmanuel Briot
2011-01-31 20:17               ` björn lundin
2011-02-01  9:49               ` björn lundin
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