From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c9d14a9b4208ef0b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-17 19:41:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!kibo.news.demon.net!news.demon.co.uk!demon!crushed.velvet.net!not-for-mail From: Aidan Skinner Newsgroups: comp.lang.ada Subject: Re: XML generator Date: Sat, 18 May 2002 02:32:18 +0000 (UTC) Organization: Velvet Networks Message-ID: References: <3CE02EE1.8FEBD4DE@despammed.com> <3CE03784.DD40698E@despammed.com> <3CE14210.AC3FC998@despammed.com> <3CE2875B.F2A54C0D@despammed.com> <3CE2DF3C.682F07C4@despammed.com> NNTP-Posting-Host: localhost.velvet.net X-NNTP-Posting-Host: crushed.velvet.net:62.49.231.23 X-Trace: news.demon.co.uk 1021689612 nnrp-01:7136 NO-IDENT crushed.velvet.net:62.49.231.23 X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sat, 18 May 2002 02:32:18 +0000 (UTC) User-Agent: slrn/0.9.7.2 (OpenBSD) Xref: archiver1.google.com comp.lang.ada:24326 Date: 2002-05-18T02:32:18+00:00 List-Id: On Fri, 17 May 2002 09:40:26 -0400, Marin David Condic wrote in : > 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.