with Ada.Text_IO; with Sax.Readers; with Input_Sources.Strings; with Unicode.CES.Utf8; with DOM.Readers; with DOM.Core.Documents; with DOM.Core.Nodes; with DOM.Core.Attrs; procedure Extract_Students is Sample_String : String := "" & "" & "" & "" & "" & "" & "" & "" & ""; Input : Input_Sources.Strings.String_Input; Reader : DOM.Readers.Tree_Reader; Document : DOM.Core.Document; List : DOM.Core.Node_List; begin Input_Sources.Strings.Open (Sample_String, Unicode.CES.Utf8.Utf8_Encoding, Input); DOM.Readers.Parse (Reader, Input); Input_Sources.Strings.Close (Input); Document := DOM.Readers.Get_Tree (Reader); List := DOM.Core.Documents.Get_Elements_By_Tag_Name (Document, "Student"); for I in 0 .. DOM.Core.Nodes.Length (List) - 1 loop Ada.Text_IO.Put_Line (DOM.Core.Attrs.Value (DOM.Core.Nodes.Get_Named_Item (DOM.Core.Nodes.Attributes (DOM.Core.Nodes.Item (List, I)), "Name") ) ); end loop; DOM.Readers.Free (Reader); end Extract_Students;