File: domschemaexample.adb

package info (click to toggle)
libxmlada 25.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,212 kB
  • sloc: ada: 78,068; sh: 3,310; makefile: 394; xml: 111; python: 39
file content (26 lines) | stat: -rw-r--r-- 598 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--
--  Copyright (C) 2017, AdaCore
--

with Input_Sources.File; use Input_Sources.File;
with Sax.Readers;        use Sax.Readers;
with DOM.Core;           use DOM.Core;
with Schema.Dom_Readers; use Schema.Dom_Readers;

procedure DomSchemaExample is
   Input  : File_Input;
   Reader : Schema.Dom_Readers.Tree_Reader;
   Doc    : Document;
begin
   Set_Public_Id (Input, "Preferences file");
   Open ("pref_with_xsd.xml", Input);

   Set_Feature (Reader, Validation_Feature, False);

   Parse (Reader, Input);
   Close (Input);

   Doc := Get_Tree (Reader);

   Free (Reader);
end DomSchemaExample;