comp.lang.ada
 help / color / mirror / Atom feed
* xml/ada dropping data when pre-defined entities are separated by space?
@ 2011-01-27 10:06 björn lundin
  2011-01-27 11:12 ` Georg Bauhaus
  0 siblings, 1 reply; 12+ messages in thread
From: björn lundin @ 2011-01-27 10:06 UTC (permalink / raw)


Hi !
I wonder if anyone has encountered difficulties with xml/ada
when parsing documents containing the pre-defined entities like &

When having one of these, it is ok, but if two appear, separated with
space,
the rest of the text is dropped.

This is with xml/ada 3.2.1 gpl, dowloaded 27-jan-2011 from libre of
act


in the output below, I'd like to se ' & DEF' as well on the first
row...


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_Str : String := "<?xml version='1.0' encoding='ISO-8859-1'?
><env><Row>ABC &amp; &amp; DEF</Row><Row>ABC &amp;&amp; DEF</
Row><Row>ABC _ DEF</Row></env>";
    Input   : String_Input;
    Reader  : Tree_Reader;
    Doc     : Document;
    List    : Node_List;
    N       : 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 := Reader.Get_Tree;
    List := Get_Elements_By_Tag_Name(Doc, "Row");
    for Index in 1 .. Length (List) loop
      N := Item(List, Index - 1);
      Ada.Text_IO.Put_Line("Value of Row is: " &  Node_Value
(First_Child (N)));
    end loop;
end Test_Xml_Dom;

testrun:
c:\>test_xml_dom.exe
Value of Row is: ABC &
Value of Row is: ABC && DEF
Value of Row is: ABC _ DEF


/Björn



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-02-01 18:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2011-02-01 18:24                 ` Vadim Godunko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox