comp.lang.ada
 help / color / mirror / Atom feed
From: Serge Robyns <serge.robyns@gmail.com>
Subject: Trying to make XMLada use a validating SAX Parser
Date: Thu, 4 Jun 2015 13:59:26 -0700 (PDT)
Date: 2015-06-04T13:59:26-07:00	[thread overview]
Message-ID: <463dff12-1b11-4f09-9d61-a46de6036c24@googlegroups.com> (raw)

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



             reply	other threads:[~2015-06-04 20:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-04 20:59 Serge Robyns [this message]
2015-06-04 21:47 ` Trying to make XMLada use a validating SAX Parser Simon Wright
2015-06-05 15:47   ` Serge Robyns
2015-06-05 17:50     ` David Botton
2015-06-05 23:33       ` Vadim Godunko
2015-06-06  8:22       ` Pascal Obry
2015-06-06 10:04         ` Serge Robyns
2015-06-07  3:42           ` David Botton
2015-06-07  7:19             ` Simon Wright
2015-06-07 12:00               ` David Botton
2015-06-07  3:29         ` David Botton
2015-06-08 22:45 ` wowwomenonwheels205
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox