[gtkada] reading Xml with Glib.xml
Borja Martín
borjam at dagi3d.net
Sun Apr 6 18:14:11 CEST 2003
hi, I'm trying to make a validation function where the users data are
stored in a xml file, so I'm using glib.xml package in order to achieve this.
The problem I have is that I'm only able to access to the first node of the
xml and cannot read the "brothers" of that node. this are the pieces of
code I have so far:
the xml file:
<users>
<user id='customer'>
<level>customer</level>
<pass>1ab5bf2311c3c4909221ac089eaf3564</pass>
</user>
<user id='admin1'>
<level>admin</level>
<pass>1ab5bf2311c3c4909221ac089eaf3564</pass>
</user>
<user id='admin2'>
<level>admin</level>
<pass>1ab5bf2311c3c4909221ac089eaf3564</pass>
</user>
</users>
the function:
function Login(username: String; pass: String) return LevelType is
rootNode: Node_Ptr := Parse(USERSFILE);
begin
while rootNode /= null loop
put_line(Get_Attribute(rootNode, "id").all);
rootNode := rootNode.next;
end loop;
return InvalidUser;
end login;
So, only the id of the first node is printed.
Any idea?
Thx in advance.
/*********************
* Dagi3d v3.0
* http://dagi3d.net
*********************/
More information about the gtkada
mailing list