Bumping manifests a=b2g-bump
[gecko.git] / parser / xml / nsISAXErrorHandler.idl
blobea8af79ce8bcdacadd103bc8809770f29d77b006
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsISupports.idl"
8 interface nsISAXLocator;
10 /**
11 * Basic interface for SAX error handlers.
13 * If a SAX application needs to implement customized error
14 * handling, it must implement this interface and then register an
15 * instance with the XML reader. The parser will then report all
16 * errors and warnings through this interface.
18 * WARNING: If an application does not register an ErrorHandler,
19 * XML parsing errors will go unreported. In order to detect validity
20 * errors, an ErrorHandler that does something with error() calls must
21 * be registered.
24 [scriptable, uuid(e02b6693-6cca-11da-be43-001422106990)]
25 interface nsISAXErrorHandler: nsISupports {
27 /**
28 * Receive notification of a recoverable error.
30 * This corresponds to the definition of "error" in section 1.2
31 * of the W3C XML 1.0 Recommendation. For example, a validating
32 * parser would use this callback to report the violation of a
33 * validity constraint. The default behaviour is to take no
34 * action.
36 * The SAX parser must continue to provide normal parsing events
37 * after invoking this method: it should still be possible for the
38 * application to process the document through to the end. If the
39 * application cannot do so, then the parser should report a fatal
40 * error even if the XML recommendation does not require it to do
41 * so.
43 * Filters may use this method to report other, non-XML errors as
44 * well.
46 * @param locator The locator object for the error (may be null).
47 * @param error The error message.
49 void error(in nsISAXLocator locator, in AString error);
51 /**
52 * Receive notification of a non-recoverable error.
54 * There is an apparent contradiction between the documentation
55 * for this method and the documentation for
56 * ContentHandler.endDocument(). Until this ambiguity is resolved in
57 * a future major release, clients should make no assumptions about
58 * whether endDocument() will or will not be invoked when the parser
59 * has reported a fatalError() or thrown an exception.
61 * This corresponds to the definition of "fatal error" in section
62 * 1.2 of the W3C XML 1.0 Recommendation. For example, a parser
63 * would use this callback to report the violation of a
64 * well-formedness constraint.
66 * The application must assume that the document is unusable
67 * after the parser has invoked this method, and should continue (if
68 * at all) only for the sake of collecting additional error
69 * messages: in fact, SAX parsers are free to stop reporting any
70 * other events once this method has been invoked.
72 * @param locator The locator object for the error (may be null).
73 * @param error The error message.
75 void fatalError(in nsISAXLocator locator, in AString error);
77 /**
78 * Receive notification of a warning.
80 * SAX parsers will use this method to report conditions that are
81 * not errors or fatal errors as defined by the XML
82 * recommendation. The default behaviour is to take no action.
84 * The SAX parser must continue to provide normal parsing events
85 * after invoking this method: it should still be possible for the
86 * application to process the document through to the end.
88 * Filters may use this method to report other, non-XML warnings
89 * as well.
91 * @param locator The locator object for the warning (may be null).
92 * @param error The warning message.
94 void ignorableWarning(in nsISAXLocator locator, in AString error);