1------------------------------------------------------------------------------ 2-- XML/Ada - An XML suite for Ada95 -- 3-- -- 4-- Copyright (C) 2004-2017, AdaCore -- 5-- -- 6-- This library is free software; you can redistribute it and/or modify it -- 7-- under terms of the GNU General Public License as published by the Free -- 8-- Software Foundation; either version 3, or (at your option) any later -- 9-- version. This library is distributed in the hope that it will be useful, -- 10-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- 11-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- 12-- -- 13-- As a special exception under Section 7 of GPL version 3, you are granted -- 14-- additional permissions described in the GCC Runtime Library Exception, -- 15-- version 3.1, as published by the Free Software Foundation. -- 16-- -- 17-- You should have received a copy of the GNU General Public License and -- 18-- a copy of the GCC Runtime Library Exception along with this program; -- 19-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- 20-- <http://www.gnu.org/licenses/>. -- 21-- -- 22------------------------------------------------------------------------------ 23 24pragma Ada_05; 25private with Ada.Tags; 26 27package Schema is 28 29 procedure Set_Debug_Output (Output : Boolean); 30 -- Whether we should output debug traces 31 32 XML_Not_Implemented : exception; 33 -- Raised when a schema uses features that are not supported by XML/Ada yet 34 35 XML_Limitation : exception; 36 -- Raised for internal XML/Ada limitations. The XSD file is most likely 37 -- valid, but not supported by XML/Ada. 38 39 Dump_Internal_XSD : Boolean := False; 40 -- If set to True, dump on stdout the structure that was created when 41 -- parsing the .xsd files. In particular, this is used to create 42 -- the metaschema grammar internally, rather than part it from file 43 -- every time. 44 45private 46 47 ----------- 48 -- Debug -- 49 ----------- 50 -- The following subprograms are used to print debug traces for XML/Ada 51 -- itself, and should not be used in user applications 52 53 type Debug_Output_Mode is 54 (Debug_Default, 55 Debug_Seen, -- to show elements seen in XML stream 56 Debug_Action); -- to show actions performed on the grammars 57 58 procedure Debug_Push_Prefix 59 (Append : String; Mode : Debug_Output_Mode := Debug_Default); 60 procedure Debug_Pop_Prefix; 61 -- Append a prefix to the current output 62 63 function Debug_Tag_Name (Self : Ada.Tags.Tag) return String; 64 -- Return the external name for Self 65 66 procedure Debug_Output 67 (Str : String; Mode : Debug_Output_Mode := Debug_Default); 68 pragma Inline (Debug_Output); 69 -- Display a string for debugging purposes 70 71 procedure Output_Action (Str : String); 72 procedure Output_Seen (Str : String); 73 pragma Inline (Output_Action, Output_Seen); 74 -- Same as Debug_Output (Str, Debug_Action); 75 -- or Debug_Output (Debug_Seen); 76 77 Debug : Boolean := False; 78 -- Whether we are in debug mode. 79 -- The above subprograms do nothing if not in debug mode, but this 80 -- variable can be used to avoid preparing strings for display if we are 81 -- not going to display them afterward. 82 83end Schema; 84