comp.lang.ada
 help / color / mirror / Atom feed
From: "Frank" <myworstenemy@somewhere.com>
Subject: XML/Ada 1.0 - SAX - Attribute converted from String to Integer
Date: Sat, 27 Aug 2005 19:29:40 +0200
Date: 2005-08-27T19:29:40+02:00	[thread overview]
Message-ID: <4310a326$1@news.broadpark.no> (raw)

Hi!

I am programming an interface that reads an XML file, that contains integers 
in Attributes.

E.g

<Data height="21" width="91"></Data>

I am using SAX from XML/Ada 1.0. I wish to retrieve the data from the 
attributes (e.g from height) and put them into
variables of their respective types in Ada (Integers)

Current solution:
I have created:
package XML_Integer_IO is new Ada.Text_IO.Integer_IO(Integer);

I Get_Value the height fromt the element and get Unicode.CES.Byte_Sequence 
as result.
I converted this Unicode.CES.Byte_Sequence to String
Then I use Get from XML_Integer_IO to grab the integer out of the string 
into a Integer variable.

Is this the way it should be done? I would imagine some kind of 
"Get_Value_As_Integer" readymade in the XML library.

Frank





             reply	other threads:[~2005-08-27 17:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-27 17:29 Frank [this message]
2005-08-27 20:58 ` XML/Ada 1.0 - SAX - Attribute converted from String to Integer Simon Wright
2005-08-28 19:32 ` Georg Bauhaus
replies disabled

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