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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.98.23.23 with SMTP id 23mr5975989pfx.11.1466811671139; Fri, 24 Jun 2016 16:41:11 -0700 (PDT) X-Received: by 10.157.41.105 with SMTP id d96mr204670otb.19.1466779494141; Fri, 24 Jun 2016 07:44:54 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!jk6no280372igb.0!news-out.google.com!i62ni1817ith.0!nntp.google.com!r1no285010ige.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 24 Jun 2016 07:44:54 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.218.37.33; posting-account=W2gdXQoAAADxIuhBWhPFjUps3wUp4RhQ NNTP-Posting-Host: 76.218.37.33 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <139d39ee-c198-4a63-a5c6-9cb265820edb@googlegroups.com> Subject: generating an XML file using Ada code From: Stephen Leake Injection-Date: Fri, 24 Jun 2016 23:41:11 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:30906 Date: 2016-06-24T07:44:54-07:00 List-Id: I'm working on syncing a database between Windows and Android. The Android framework for doing this requires a "changes" file, in either XML or JSON format. So on the Windows side I need to log all db operations to either xml or json. Using xmlada, I don't see any way to output a file; I searched for "Text_IO" in the installed library code, and found only input functions. One of the xml tutorials mentions the C function "xmlSaveFormatFile"; I can't find that in the Ada code. This question has been asked before on this list, several years ago; I hope there is a better answer now. How can I create an XML file? For JSON, there is the GNATColl.JSON package, which provides a "Write" function that serializes a JSON object to a string. So I can use that, but I prefer XML (it feels more Ada-like :). -- Stephe