~ubuntu-branches/ubuntu/hoary/gnucash/hoary

« back to all changes in this revision

Viewing changes to src/experimental/ofx/ofx-dtd-idl.txt

  • Committer: Bazaar Package Importer
  • Author(s): James A. Treacy
  • Date: 2002-03-16 14:14:59 UTC
  • Revision ID: james.westby@ubuntu.com-20020316141459-wtkyyrpfovryhl1s
Tags: upstream-1.6.6
ImportĀ upstreamĀ versionĀ 1.6.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
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 
 
4
of any resources?
 
5
 
 
6
----------
 
7
 
 
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
 
11
vaguely like this:
 
12
 
 
13
<transaction>
 
14
   <date>March 10, 1998</date>
 
15
   <amount>$300.00</amount>
 
16
   <description>Buy new microwave oven</description>
 
17
</transaction>
 
18
 
 
19
Quicken and bank web sites send these things to each other to do on-line
 
20
banking.
 
21
 
 
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 
 
24
look vaguely like:
 
25
 
 
26
class Transaction {
 
27
   public:
 
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);
 
34
   private:
 
35
      time_t date;
 
36
      double amount;
 
37
      char * description;
 
38
};
 
39
 
 
40
Lists of transactions form an account, etc.
 
41
 
 
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:
 
47
 
 
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?
 
52
 
 
53
---------------------------------------------------------------
 
54
 
 
55
More specifically, given the DTD
 
56
 
 
57
<!ELEMENT transaction - - (date, amount, description) >
 
58
<!ELEMENT date        - - %datetype >
 
59
<!ELEMENT amount      - - %numerictype >
 
60
<!ELEMENT description - - %stringtype >
 
61
 
 
62
I want something that will read this, and *automatically* spit out the
 
63
following ascii stream:
 
64
 
 
65
class Transaction {
 
66
    time_t date;
 
67
    double amount;
 
68
    char * description;
 
69
};
 
70
 
 
71
---------------------------------------------------------------
 
72
James Clark's SGML/Parser (SP)  http://www.jclark.com/sp/index.htm
 
73
Jade
 
74
 
 
75
dssslist@mulberrytech.com
 
76
 
 
77
--------------------------------------------------------------
 
78
--linas
 
79
 
 
80
10 March 1998
 
81
 
 
82