comp.lang.ada
 help / color / mirror / Atom feed
From: Sonia Dalal <sonia12106@iiitd.ac.in>
Subject: Re: Validating XML using Ada schema module
Date: Sat, 9 May 2015 09:49:46 -0700 (PDT)
Date: 2015-05-09T09:49:46-07:00	[thread overview]
Message-ID: <bd2ad640-2d59-405e-9f7f-256e8cc29322@googlegroups.com> (raw)
In-Reply-To: <milahi$akt$2@dont-email.me>

On Saturday, May 9, 2015 at 9:24:29 PM UTC+5:30, björn lundin wrote:
> On 2015-05-08 12:20, Sonia Dalal wrote:
> 
> > The above code is what I have used in my xsd and I am following the Ada documentation to generate grammar.
> 
> You do not show the actual Ada code.
> 
> > I am using GNAT 4.6 so it should be Ada 2005.
> > Is it possible that it is due to some dependency or version clashes?
> 
> Maybe - or it is your code. But since you don't show your code
> it is impossible to tell...
> 
> --
> Björn


<?xml version="1.0"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
---------------------------------This is the xsd file data---------------------
<xs:element name="note">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="to" type="xs:string"/>
      <xs:element name="from" type="xs:string"/>
      <xs:element name="heading" type="xs:string"/>
      <xs:element name="body" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

</xs:schema>

-----------This is the file which is being used to generate grammar-------------

with Ada.Text_IO;   use Ada.Text_IO;
with Schema.Schema_Readers, Schema.Validators, Input_Sources.File;
use  Schema.Schema_Readers, Schema.Validators, Input_Sources.File;

procedure SchemaExample is
   Grammar : XML_Grammar;
   Schema  : Schema_Reader;
   Read    : File_Input;
begin
   Open ("pref.xsd", Read);
   Parse (Schema, Read);
   Close (Read);

   Grammar := Get_Grammar (Schema);

 exception
    when XML_Validation_Error =>
       Put_Line ("ERROR: " & Get_Error_Message (Schema));
end SchemaExample;


  reply	other threads:[~2015-05-09 16:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-07 15:53 Validating XML using Ada schema module Sonia Dalal
2015-05-07 15:58 ` Björn Lundin
2015-05-07 16:47   ` Simon Wright
2015-05-08 10:20 ` Sonia Dalal
2015-05-09 15:55   ` Björn Lundin
2015-05-09 16:49     ` Sonia Dalal [this message]
2015-05-09 21:08       ` Björn Lundin
2015-05-10 18:16         ` Simon Wright
2015-05-11 12:17         ` Sonia Dalal
2015-05-12 20:32           ` Björn Lundin
2015-05-14  6:00             ` Sonia Dalal
2015-05-14 12:41               ` Björn Lundin
2015-05-14 14:21                 ` Sonia Dalal
2015-05-14 15:06                   ` Sonia Dalal
2015-05-14 15:56                     ` Björn Lundin
replies disabled

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