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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4c3a4cac2a77bb10 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news1.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: XMLAda dom document to string Date: Thu, 14 Apr 2005 09:26:18 +0200 Message-ID: <425E1B1A.7020102@mailinator.com> References: <425CC45E.20404@mailinator.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net w0m7sFXIULwK3RWG9dP/2A1ihavKpxxLsCMUC7NGXEH65KkTE= User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) X-Accept-Language: en-us, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:10448 Date: 2005-04-14T09:26:18+02:00 List-Id: Bj�rn Lundin wrote: > > 2005-04-13 kl. 09.03 skrev Alex R. Mosteo: > >> Bj�rn Lundin wrote: >> >>> Hello! Is there a way of converting a dom document from XML/Ada >>> (1.0) to a string? I found a Print in DOM.Core.Nodes that prints >>> out a document to std out. That is actually what I want, but to a >>> string instead, that I can put through a socket later on. I'm >>> sure I've missed something obvious, but I can't see through it. >>> I've also found on a wiki, a way of walking the nodes in a >>> document., by David Button, I've been thinking of using it, as a >>> template for a new procedure/function that does what I want, but >>> I thought I'd ask here first, before I invent the wheel again. >> >> >> AFAIK, this is not present in that release of XML/Ada. I modified >> the Print function to get a string. You can look at it at >> >> http://deepsix.homeip.net/svn/Adagio%20head/src/agpl/dom-core-nodes- >> output.ads >> http://deepsix.homeip.net/svn/Adagio%20head/src/agpl/dom-core-nodes- >> output.adb > > > Great, just what I was after :) > > Curiosity : what are you escaping? Agpl.Xml.Escape is found in the > body, which I removed. All the code is at http://deepsix.homeip.net/svn/ ------------ -- Escape -- ------------ -- Takes a Latin1 string and encodes all invalid characters as &, <, etc. Not sure if that function is in fact 100% right for XML syntax. It changes an attribute name (not value!) like "avi�n" into "avión" and the like. About the license, it may be indeed that it must be GMGPL because XML/Ada is. I copied/pasted the license block in the rest of my original code, but here we're talking about a modification of XML/Ada so I presume I must maintain the original license (which I'm not interested in modifying, I simply didn't thought of it until now). I presume that any modification introduced in the GPL such as the GMGPL is propagated? I mean, Could someone provide a more restrictive license for a derivative work? In any case I will reflect this change in the file license ASAP. >> but be warned that it performs some pretty printing and by that >> reason Windows-style new lines are embedded in the resulting >> string. > > > I can live with that. There are too some chunks of whitespace for tabulating. That can add quite some size. You may want to remove that too if the XML generated is never for human consumption.