2 Copyright (C) 2000-2003 SKYRIX Software AG
4 This file is part of OGo
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
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.
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
23 #ifndef __SaxLexicalHandler_H__
24 #define __SaxLexicalHandler_H__
26 #import <Foundation/NSString.h>
31 SAX2 extension handler for lexical events.
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.
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
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.
49 @protocol SaxLexicalHandler
52 Report an XML comment anywhere in the document.
54 This callback will be used for comments inside or outside the document
55 element, including comments in the external DTD subset (if read).
57 - (void)comment:(unichar *)_chars length:(int)_len;
60 Report the start of DTD declarations, if any.
62 Any declarations are assumed to be in the internal subset unless
63 otherwise indicated by a startEntity event.
65 Note that the start/endDTD events will appear within the
66 start/endDocument events from ContentHandler and before the first
69 - (void)startDTD:(NSString *)_name
70 publicId:(NSString *)_pub
71 systemId:(NSString *)_sys;
73 /* Report the end of DTD declarations. */
77 Report the beginning of an entity in content.
79 NOTE: entity references in attribute values -- and the start and end
80 of the document entity -- are never reported.
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.
86 Note that skipped entities will be reported through the skippedEntity
87 event, which is part of the ContentHandler interface.
89 If it is a parameter entity, the name will begin with '%'.
91 - (void)startEntity:(NSString *)_name;
93 /* report the end of an entity */
94 - (void)endEntity:(NSString *)_name;
97 Report the start of a CDATA section.
99 The contents of the CDATA section will be reported through the regular
104 /* Report the end of a CDATA section */
109 #endif /* __SaxLexicalHandler_H__ */