From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a525118741961e98 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!o8g2000vbq.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?bj=F6rn_lundin?= Newsgroups: comp.lang.ada Subject: Re: xml/ada dropping data when pre-defined entities are separated by space? Date: Sat, 29 Jan 2011 13:49:31 -0800 (PST) Organization: http://groups.google.com Message-ID: <5e91567e-883f-428c-b01e-ee51e91ca30f@o8g2000vbq.googlegroups.com> References: <05aafe44-cdd9-4c28-8e3f-24ecd9067ab3@u6g2000vbh.googlegroups.com> <4d415333$0$6769$9b4e6d93@newsspool3.arcor-online.net> <839dbe65-e971-4db7-ad25-269253f02c69@c10g2000vbv.googlegroups.com> NNTP-Posting-Host: 85.230.244.231 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1296337772 2024 127.0.0.1 (29 Jan 2011 21:49:32 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 29 Jan 2011 21:49:32 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: o8g2000vbq.googlegroups.com; posting-host=85.230.244.231; posting-account=3_reEwoAAAC163IAIrx427KYmwahFuh9 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; sv-SE; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:17769 Date: 2011-01-29T13:49:31-08:00 List-Id: On 29 Jan, 18:13, Simon Wright wrote: > There are in fact 2 nodes in the first line. > > Dom.Core.Nodes.Child_Nodes returns a Node_List; look in Dom.Core.Nodes > for the Node_List operations Item and Length. Yes, there it is:-) Thanks for the pointer, now i get more what i like with Input_Sources.Strings; use Input_Sources.Strings; with Sax.Readers; use Sax.Readers; with DOM.Readers; use DOM.Readers; with DOM.Core; use DOM.Core; with DOM.Core.Documents; use DOM.Core.Documents; with DOM.Core.Nodes; use DOM.Core.Nodes; with Ada.Text_IO; with Unicode.CES.Basic_8bit; procedure Test_Xml_Dom is Xml_Str1 : String :=3D ""; xml_str2 : String :=3D "ABC & & DEFABC && DEFABC _ DEF"; Xml_Str : String :=3D xml_str1 & Xml_Str2; Input : String_Input; Reader : Tree_Reader; Doc : Document; List,cl : Node_List; N,c : Node; begin Open(Xml_Str, Unicode.CES.Basic_8bit.Basic_8bit_Encoding,Input); Reader.Set_Feature(Validation_Feature, False); Reader.Set_Feature(Namespace_Feature, False); Reader.Parse(Input); Input.Close; Doc :=3D Reader.Get_Tree; List :=3D Get_Elements_By_Tag_Name(Doc, "Row"); for Index in 1 .. Length (List) loop N :=3D Item(List, Index - 1); cl:=3Dchild_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; end Test_Xml_Dom; gives bnl@ubuntu-virtual:~$ ./test_xml Value of Row is: ABC & Value of node is: ABC & Value of node is: & DEF Value of Row is: ABC && DEF Value of node is: ABC && DEF Value of Row is: ABC _ DEF Value of node is: ABC _ DEF /Bj=F6rn