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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1209fade47f04dc6,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-26 15:23:53 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.stueberl.de!newspeer1-gui.server.ntli.net!ntli.net!newsfep4-glfd.server.ntli.net.POSTED!53ab2750!not-for-mail From: "chris.danx" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en, en-us MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: OO, DOM & XML/Ada Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Wed, 26 Mar 2003 23:24:04 +0000 NNTP-Posting-Host: 81.98.236.72 X-Complaints-To: abuse@ntlworld.com X-Trace: newsfep4-glfd.server.ntli.net 1048721032 81.98.236.72 (Wed, 26 Mar 2003 23:23:52 GMT) NNTP-Posting-Date: Wed, 26 Mar 2003 23:23:52 GMT Organization: ntl Cablemodem News Service Xref: archiver1.google.com comp.lang.ada:35744 Date: 2003-03-26T23:24:04+00:00 List-Id: Hi, I've been trying to implement an OO DOM and I think I know why the authors of XML/Ada did it with variant records instead of OO. It's a wee bit difficult to implement. Firstly, nodes have to be updatable and changes must be 'live' ("changes to the underlying document structure are reflected in all relevant NodeList and NamedNodeMap objects" according to the spec). Secondly, "Node" contains a "Document" which is a decendant of Node. I can sortof handle both of the issues, but it does require a little bit of indirection and quite a few pointers. I'm wondering if there's a better way, or if an OO DOM is really necessary. Thoughts are appreciated. This is the current state of affairs... package Dom.Core.Nodes is type Node is tagged private; type Node_Access is access all Node'class; ... private type Node_Rep; type Node_Rep_Access is access Node_Rep; type Node_Rep is record Name : Dom_String_Access; Value : Dom_String_Access; Kind : Node_Type; Par : Node_Access; prevSib : Node_Access; NextSib : Node_Access; Doc : Node_Access; -- TBC end record; type Node is tagged record underlying : Node_Rep_Access; end record; ... end Dom.Core.Nodes;