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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.182.246.134 with SMTP id xw6mr52424936obc.38.1433451566807; Thu, 04 Jun 2015 13:59:26 -0700 (PDT) X-Received: by 10.140.100.136 with SMTP id s8mr56388qge.2.1433451566776; Thu, 04 Jun 2015 13:59:26 -0700 (PDT) Path: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!h15no452221igd.0!news-out.google.com!k20ni45177qgd.0!nntp.google.com!z60no324895qgd.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 4 Jun 2015 13:59:26 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.201.165.65; posting-account=6m7axgkAAADBKh082FfZLdYsJ24CXYi5 NNTP-Posting-Host: 85.201.165.65 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <463dff12-1b11-4f09-9d61-a46de6036c24@googlegroups.com> Subject: Trying to make XMLada use a validating SAX Parser From: Serge Robyns Injection-Date: Thu, 04 Jun 2015 20:59:26 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: number.nntp.giganews.com comp.lang.ada:193491 Date: 2015-06-04T13:59:26-07:00 List-Id: Being very new to the Ada object programming and desiring to write an application in Ada that is capable of reading XML data I'm fighting to use XMLada. The AdaCore documentation and Google isn't providing much help. I've managed to do some stuff in Ada in the past (booting a full native gnat kernel attempt, back in 2001). So far I managed to: 1) use a SAX parser to read the file and create ADA objects. (SAX.Readers.Reader) 2) use the DOM reader to read an XML file and and walk the tree. 3) use the DOM reader and have the file validated by the XSD. (Schema.Dom_Readers.Tree_Reader) and walk the tree. 4) use the SAX validating parser to validate the XML file. (Schema.Readers.Validating_Reader) but without creating Ada objects. But what doesn't work is to use the SAX validating parser to validate and call the callbacks to build my objects. Below is the code I'm trying to compile: with Unicode.CES; with Sax.Readers; with Sax.Attributes; with Schema.Readers; package MyXML is -- type MyReader is new SAX.Readers.Reader with null record; type MyReader is new Schema.Readers.Validating_Reader with null record; overriding procedure Start_Element ( Handler : in out MyReader; The_Namespace_URI : Unicode.CES.Byte_Sequence := ""; The_Local_Name : Unicode.CES.Byte_Sequence := ""; Qname : Unicode.CES.Byte_Sequence := ""; Atts : Sax.Attributes.Attributes'Class ); end MyXML; When I try to compile the compiler complains that the subprogram "Start_Element" is not overriding. However, according to the adacore documentation for xmlada it does say in section 6.4 that "As usual, you can still override the predefined ....". Does anyone have an explanation for my error? Thanks you. Serge