1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is mozilla.org code.
16 *
17 * The Initial Developer of the Original Code is Robert Sayre.
18 *
19 * Portions created by the Initial Developer are Copyright (C) 2005
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 *
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
35 *
36 * ***** END LICENSE BLOCK ***** */
37
38 #include "nsISupports.idl"
39
40 /**
41 * Receive notification of basic DTD-related events.
42 *
43 * If a SAX application needs information about notations and
44 * unparsed entities, then the application implements this interface
45 * and registers an instance with the SAX parser using the parser's
46 * setDTDHandler method. The parser uses the instance to report
47 * notation and unparsed entity declarations to the application.
48 *
49 * Note that this interface includes only those DTD events that the
50 * XML recommendation requires processors to report: notation and
51 * unparsed entity declarations.
52 *
53 * The SAX parser may report these events in any order, regardless
54 * of the order in which the notations and unparsed entities were
55 * declared; however, all DTD events must be reported after the
56 * document handler's startDocument event, and before the first
57 * startElement event. (If the LexicalHandler is used, these events
58 * must also be reported before the endDTD event.)
59 */
60 [scriptable, uuid(4d01f225-6cc5-11da-be43-001422106990)]
61 interface nsISAXDTDHandler : nsISupports {
62
63 /**
64 * Receive notification of a notation declaration event.
65 *
66 * It is up to the application to record the notation for later
67 * reference, if necessary; notations may appear as attribute values
68 * and in unparsed entity declarations, and are sometime used with
69 * processing instruction target names.
70 *
71 * At least one of publicId and systemId must be non-null. If a
72 * system identifier is present, and it is a URL, the SAX parser
73 * must resolve it fully before passing it to the application
74 * through this event.
75 *
76 * There is no guarantee that the notation declaration will be
77 * reported before any unparsed entities that use it.
78 *
79 * @param name The notation name.
80 * @param publicId The notation's public identifier, or null if none was
81 * given.
82 * @param systemId The notation's system identifier, or null if none was
83 * given.
84 */
85 void notationDecl(in AString name,
86 in AString publicId,
87 in AString systemId);
88
89 /**
90 * Receive notification of an unparsed entity declaration event.
91 *
92 * Note that the notation name corresponds to a notation reported
93 * by the notationDecl event. It is up to the application to record
94 * the entity for later reference, if necessary; unparsed entities
95 * may appear as attribute values.
96 *
97 * If the system identifier is a URL, the parser must resolve it
98 * fully before passing it to the application.
99 *
100 * @param name The unparsed entity's name.
101 * @param publicId The entity's public identifier, or null if none was
102 * given.
103 * @param systemId The entity's system identifier, or null if none was
104 * given.
105 * @param notationName The name of the associated notation.
106 */
107 void unparsedEntityDecl(in AString name, in AString publicId,
108 in AString systemId, in AString notationName);
109 };