1 | // |
---|
2 | // DTDHandler.h |
---|
3 | // |
---|
4 | // $Id: //poco/1.3/XML/include/Poco/SAX/DTDHandler.h#1 $ |
---|
5 | // |
---|
6 | // Library: XML |
---|
7 | // Package: SAX |
---|
8 | // Module: SAX |
---|
9 | // |
---|
10 | // SAX DTDHandler Interface. |
---|
11 | // |
---|
12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. |
---|
13 | // and Contributors. |
---|
14 | // |
---|
15 | // Permission is hereby granted, free of charge, to any person or organization |
---|
16 | // obtaining a copy of the software and accompanying documentation covered by |
---|
17 | // this license (the "Software") to use, reproduce, display, distribute, |
---|
18 | // execute, and transmit the Software, and to prepare derivative works of the |
---|
19 | // Software, and to permit third-parties to whom the Software is furnished to |
---|
20 | // do so, all subject to the following: |
---|
21 | // |
---|
22 | // The copyright notices in the Software and this entire statement, including |
---|
23 | // the above license grant, this restriction and the following disclaimer, |
---|
24 | // must be included in all copies of the Software, in whole or in part, and |
---|
25 | // all derivative works of the Software, unless such copies or derivative |
---|
26 | // works are solely in the form of machine-executable object code generated by |
---|
27 | // a source language processor. |
---|
28 | // |
---|
29 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
---|
30 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
---|
31 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT |
---|
32 | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE |
---|
33 | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, |
---|
34 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
---|
35 | // DEALINGS IN THE SOFTWARE. |
---|
36 | // |
---|
37 | |
---|
38 | |
---|
39 | #ifndef SAX_DTDHandler_INCLUDED |
---|
40 | #define SAX_DTDHandler_INCLUDED |
---|
41 | |
---|
42 | |
---|
43 | #include "Poco/XML/XML.h" |
---|
44 | #include "Poco/XML/XMLString.h" |
---|
45 | |
---|
46 | |
---|
47 | namespace Poco { |
---|
48 | namespace XML { |
---|
49 | |
---|
50 | |
---|
51 | class XML_API DTDHandler |
---|
52 | /// If a SAX application needs information about notations and unparsed entities, |
---|
53 | /// then the application implements this interface and registers an instance with the |
---|
54 | /// SAX parser using the parser's setDTDHandler method. The parser uses the instance |
---|
55 | /// to report notation and unparsed entity declarations to the application. |
---|
56 | /// |
---|
57 | /// Note that this interface includes only those DTD events that the XML recommendation |
---|
58 | /// requires processors to report: notation and unparsed entity declarations. |
---|
59 | /// |
---|
60 | /// The SAX parser may report these events in any order, regardless of the order in |
---|
61 | /// which the notations and unparsed entities were declared; however, all DTD events |
---|
62 | /// must be reported after the document handler's startDocument event, and before the first |
---|
63 | /// startElement event. (If the LexicalHandler is used, these events must also be reported before the endDTD event.) |
---|
64 | /// |
---|
65 | /// It is up to the application to store the information for future use (perhaps in a hash table or |
---|
66 | /// object tree). If the application encounters attributes of type "NOTATION", "ENTITY", or "ENTITIES", |
---|
67 | /// it can use the information that it obtained through this interface to find the entity and/or notation |
---|
68 | /// corresponding with the attribute value. |
---|
69 | { |
---|
70 | public: |
---|
71 | virtual void notationDecl(const XMLString& name, const XMLString* publicId, const XMLString* systemId) = 0; |
---|
72 | /// Receive notification of a notation declaration event. |
---|
73 | /// |
---|
74 | /// It is up to the application to record the notation for later reference, |
---|
75 | /// if necessary; notations may appear as attribute values and in unparsed |
---|
76 | /// entity declarations, and are sometime used with processing instruction |
---|
77 | /// target names. |
---|
78 | /// |
---|
79 | /// At least one of publicId and systemId must be non-null. If a system identifier |
---|
80 | /// is present, and it is a URL, the SAX parser must resolve it fully before passing |
---|
81 | /// it to the application through this event. |
---|
82 | /// |
---|
83 | /// There is no guarantee that the notation declaration will be reported before any |
---|
84 | /// unparsed entities that use it. |
---|
85 | /// |
---|
86 | /// Note that publicId and systemId maybe null, therefore we pass a pointer rather than a reference. |
---|
87 | |
---|
88 | virtual void unparsedEntityDecl(const XMLString& name, const XMLString* publicId, const XMLString& systemId, const XMLString& notationName) = 0; |
---|
89 | /// Receive notification of an unparsed entity declaration event. |
---|
90 | /// |
---|
91 | /// Note that the notation name corresponds to a notation reported by the |
---|
92 | /// notationDecl event. It is up to the application to record the entity for |
---|
93 | /// later reference, if necessary; unparsed entities may appear as attribute values. |
---|
94 | /// |
---|
95 | /// If the system identifier is a URL, the parser must resolve it fully before |
---|
96 | /// passing it to the application. |
---|
97 | /// |
---|
98 | /// Note that publicId maybe null, therefore we pass a pointer rather than a reference. |
---|
99 | |
---|
100 | protected: |
---|
101 | virtual ~DTDHandler(); |
---|
102 | }; |
---|
103 | |
---|
104 | |
---|
105 | } } // namespace Poco::XML |
---|
106 | |
---|
107 | |
---|
108 | #endif // SAX_DTDHandler_INCLUDED |
---|