2
I have this nutty idea that maybe SGML/XML DTD's can be used as a
3
kind-of corba-like IDL of sorts. Has anyone pondered this, or know
8
To be concrete, here's an example:
9
OFX (Open Financial Exchange) defines some SGML DTD's that describe a
10
document that contains financial data. An OFX document would look
14
<date>March 10, 1998</date>
15
<amount>$300.00</amount>
16
<description>Buy new microwave oven</description>
19
Quicken and bank web sites send these things to each other to do on-line
22
I am involved in a project to create a GPL'ed Quicken look-alike /
23
work-alike personal-finance package. Currently, our C++ classes
28
void SetDate (time_t date);
29
time_t GetDate (void);
30
void SetAmount (double amt);
31
double GetAmount (void);
32
void SetDescription (char *);
33
char * GetDescription (void);
40
Lists of transactions form an account, etc.
42
I hope it is now obvious to the casual reader that our in-memory layout
43
of accounts and transactions vaguely resembles the ASCII layout of an
44
OFX document. In order to provide on-line banking features in our app,
45
I'd like to get the in-memory layout resemble the ofx document as much
46
as possible. Thus, the obvious should now be obvious:
48
Are there any packages that can
49
(a) take SGML/XML DTD's and turn them into C/C++ structs/classes?
50
(b) parse the incoming text document, and build the corresponding
51
C/C++ linked-lists/trees in memory?
53
---------------------------------------------------------------
55
More specifically, given the DTD
57
<!ELEMENT transaction - - (date, amount, description) >
58
<!ELEMENT date - - %datetype >
59
<!ELEMENT amount - - %numerictype >
60
<!ELEMENT description - - %stringtype >
62
I want something that will read this, and *automatically* spit out the
63
following ascii stream:
71
---------------------------------------------------------------
72
James Clark's SGML/Parser (SP) http://www.jclark.com/sp/index.htm
75
dssslist@mulberrytech.com
77
--------------------------------------------------------------