]> err.no Git - sope/blob - sope-xml/SaxObjC/SaxLexicalHandler.h
removed NGCString
[sope] / sope-xml / SaxObjC / SaxLexicalHandler.h
1 /*
2   Copyright (C) 2000-2003 SKYRIX Software AG
3
4   This file is part of OGo
5
6   OGo is free software; you can redistribute it and/or modify it under
7   the terms of the GNU Lesser General Public License as published by the
8   Free Software Foundation; either version 2, or (at your option) any
9   later version.
10
11   OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12   WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14   License for more details.
15
16   You should have received a copy of the GNU Lesser General Public
17   License along with OGo; see the file COPYING.  If not, write to the
18   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19   02111-1307, USA.
20 */
21 // $Id$
22
23 #ifndef __SaxLexicalHandler_H__
24 #define __SaxLexicalHandler_H__
25
26 #import <Foundation/NSString.h>
27
28 /*
29   new in SAX 2.0beta
30
31   SAX2 extension handler for lexical events. 
32
33   This is an optional extension handler for SAX2 to provide lexical
34   information about an XML document, such as comments and CDATA section
35   boundaries; XML readers are not required to support this handler.
36
37   The events in the lexical handler apply to the entire document, not
38   just to the document element, and all lexical handler events must
39   appear between the content handler's startDocument and endDocument
40   events.
41
42   To set the LexicalHandler for an XML reader, use the setProperty method
43   with the propertyId "http://xml.org/sax/handlers/LexicalHandler". If
44   the reader does not support lexical events, it will throw a
45   SAXNotRecognizedException or a SAXNotSupportedException when you attempt
46   to register the handler.
47 */
48
49 @protocol SaxLexicalHandler
50
51 /*
52   Report an XML comment anywhere in the document.
53   
54   This callback will be used for comments inside or outside the document
55   element, including comments in the external DTD subset (if read).
56 */
57 - (void)comment:(unichar *)_chars length:(int)_len;
58
59 /*
60   Report the start of DTD declarations, if any.
61   
62   Any declarations are assumed to be in the internal subset unless
63   otherwise indicated by a startEntity event.
64
65   Note that the start/endDTD events will appear within the
66   start/endDocument events from ContentHandler and before the first
67   startElement event.
68 */
69 - (void)startDTD:(NSString *)_name
70   publicId:(NSString *)_pub
71   systemId:(NSString *)_sys;
72
73 /* Report the end of DTD declarations. */
74 - (void)endDTD;
75
76 /*
77   Report the beginning of an entity in content.
78   
79   NOTE: entity references in attribute values -- and the start and end
80   of the document entity -- are never reported.
81
82   The start and end of the external DTD subset are reported using the
83   pseudo-name "[dtd]". All other events must be properly nested within
84   start/end entity events.
85
86   Note that skipped entities will be reported through the skippedEntity
87   event, which is part of the ContentHandler interface.
88
89   If it is a parameter entity, the name will begin with '%'.
90 */
91 - (void)startEntity:(NSString *)_name;
92
93 /* report the end of an entity */
94 - (void)endEntity:(NSString *)_name;
95
96 /*
97   Report the start of a CDATA section.
98   
99   The contents of the CDATA section will be reported through the regular
100   characters event.
101 */
102 - (void)startCDATA;
103
104 /* Report the end of a CDATA section */
105 - (void)endCDATA;
106
107 @end
108
109 #endif /* __SaxLexicalHandler_H__ */