comp.lang.ada
 help / color / mirror / Atom feed
From: Aidan Skinner <aidan@velvet.net>
Subject: Re: XML generator
Date: Sat, 18 May 2002 02:32:18 +0000 (UTC)
Date: 2002-05-18T02:32:18+00:00	[thread overview]
Message-ID: <slrnaebf9h.tev.aidan@crushed.velvet.net> (raw)
In-Reply-To: ac318a$9l6$1@nh.pace.co.uk

On Fri, 17 May 2002 09:40:26 -0400, Marin David Condic
<dont.bother.mcondic.auntie.spam@[> wrote in
<ac318a$9l6$1@nh.pace.co.uk>:

>  amenable to DTD or databases. Do you know of some Ada code that will allow

I'd be worried if you're writing XML for which a valid DTD cannot be
produced...

>  you to create data in some form in memory and then say "Go put this out as
>  an XML file..."? It ought to be doable from a DOM implementation, but that

Not automagically.

I have a generic package that I'm using which takes in a type, an
array of strings to represent the elements/propertys, and getproperty
and setproperty methods for that type which the set takes two strings
(the name of the property and the value to set it too) and the get
function takes one string (the name of the property) and returns a
string.

Read and Write functions are provided that utilise the passed in
methods, using the SAX parser in XML/Ada. It's not pretty, it's not
big and it's not clever, but it's easier than writing custom parsing
procedures every time. All the programmer has to do is the switch
statements in the methods to translate from strings to the appropriate
type and back again. Works nicely for the one-record-per-file
structure I tend to have.

- Aidan
-- 
aidan@velvet.net  http://www.velvet.net/~aidan/  aim:aidans42
finger for pgp key fingerprint |Unix Programmer/Admin actively seeking work
01AA 1594 2DB0 09E3 B850       |CV at http://www.velvet.net/~aidan/cv.txt
C2D0 9A2C 4CC9 3EC4 75E1       |Gis a job, go on, I can do that, go on, gis it.



  reply	other threads:[~2002-05-18  2:32 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-13 21:23 XML generator Wes Groleau
2002-05-13 21:51 ` Ingo Marks
2002-05-13 22:00   ` Wes Groleau
2002-05-14 16:57     ` Wes Groleau
2002-05-15  2:59       ` Steve Doiel
2002-05-15 16:05         ` Wes Groleau
2002-05-15 16:44           ` Pascal Obry
2002-05-15 16:59             ` Marin David Condic
2002-05-15 22:20             ` Wes Groleau
2002-05-16 13:50               ` news.realtime.net
2002-05-16 14:30               ` Marin David Condic
2002-05-17  1:15                 ` Aidan Skinner
2002-05-17 13:40                   ` Marin David Condic
2002-05-18  2:32                     ` Aidan Skinner [this message]
2002-05-20 14:38                       ` Marin David Condic
2002-05-20 16:20                       ` Stephen Leake
2002-05-20 17:11                       ` Wes Groleau
2002-05-20 18:13                         ` Marin David Condic
2002-05-21 14:59                           ` Pascal Obry
2002-05-21 17:43                             ` Marin David Condic
2002-05-17 13:47                 ` Wes Groleau
2002-05-22  9:43                   ` Georg Bauhaus
2002-05-22 17:31                     ` Wes Groleau
2002-05-16  1:55           ` Steve Doiel
2002-05-16  9:49             ` Emmanuel Briot
2002-05-16 17:09             ` Wes Groleau
2002-05-19  2:54       ` David Botton
2002-05-19 20:26         ` achrist
replies disabled

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