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-20 09:34:08 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: XML generator Date: 20 May 2002 12:20:25 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) 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: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1021912049 396 128.183.220.71 (20 May 2002 16:27:29 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 20 May 2002 16:27:29 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:24421 Date: 2002-05-20T16:27:29+00:00 List-Id: Aidan Skinner writes: > 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. You could write an ASIS tool to write those switch statement procedures. Although, if you go the ASIS route, it might make sense to write the final package directly, rather than using a string-based generic. -- -- Stephe