From 20c7a5d63dc1f68fcf0e1aa053a4b725235e6f78 Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 3 Sep 2007 14:51:37 +0000 Subject: Added some XML parsing => DOM (pracro, requests and commits). --- server/src/xmlparser.cc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'server/src/xmlparser.cc') diff --git a/server/src/xmlparser.cc b/server/src/xmlparser.cc index 7e5fb14..7efdc83 100644 --- a/server/src/xmlparser.cc +++ b/server/src/xmlparser.cc @@ -62,13 +62,32 @@ void start_hndl(void *p, const char *el, const char **attr) */ // Do something reasonable with them... + if(name == "pracro") { + transaction->cpr = attributes["cpr"]; + transaction->version = attributes["version"]; + } + if(name == "request") { Request r; r.macro = attributes["macro"]; - // printf("%s\n", r.macro.c_str()); transaction->requests.push_back(r); } + if(name == "commit") { + Commit c; + c.user = attributes["user"]; + c.macro = attributes["macro"]; + c.version = attributes["version"]; + transaction->commits.push_back(c); + } + + if(name == "field") { + CommitValue v; + v.name = attributes["name"]; + v.value = attributes["value"]; + transaction->commits.back().values.push_back(v); + } + } void end_hndl(void *p, const char *el) -- cgit v1.2.3