1XML::ESISParser(3) User Contributed Perl Documentation XML::ESISParser(3)
2
3
4
6 XML::ESISParser - Perl SAX parser using nsgmls
7
9 use XML::ESISParser;
10
11 $parser = XML::ESISParser->new( [OPTIONS] );
12 $result = $parser->parse( [OPTIONS] );
13
14 $result = $parser->parse($string);
15
17 "XML::ESISParser" is a Perl SAX parser using the `nsgmls' command of
18 James Clark's SGML Parser (SP), a validating XML and SGML parser. This
19 man page summarizes the specific options, handlers, and properties sup‐
20 ported by "XML::ESISParser"; please refer to the Perl SAX standard in
21 `"SAX.pod"' for general usage information.
22
23 "XML::ESISParser" defaults to parsing XML and has an option for parsing
24 SGML.
25
26 `"nsgmls"' source, and binaries for some platforms, is available from
27 <http://www.jclark.com/>. `"nsgmls"' is included in both the SP and
28 Jade packages.
29
31 new Creates a new parser object. Default options for parsing,
32 described below, are passed as key-value pairs or as a single hash.
33 Options may be changed directly in the parser object unless stated
34 otherwise. Options passed to `"parse()"' override the default
35 options in the parser object for the duration of the parse.
36
38 The following options are supported by "XML::ESISParser":
39
40 Handler default handler to receive events
41 DocumentHandler handler to receive document events
42 DTDHandler handler to receive DTD events
43 ErrorHandler handler to receive error events
44 Source hash containing the input source for parsing
45 IsSGML the document to be parsed is in SGML
46
47 If no handlers are provided then all events will be silently ignored.
48
49 If a single string argument is passed to the `"parse()"' method, it is
50 treated as if a `"Source"' option was given with a `"String"' parame‐
51 ter.
52
53 The `"Source"' hash may contain the following parameters:
54
55 ByteStream The raw byte stream (file handle) containing the
56 document.
57 String A string containing the document.
58 SystemId The system identifier (URI) of the document.
59
60 If more than one of `"ByteStream"', `"String"', or `"SystemId"', then
61 preference is given first to `"ByteStream"', then `"String"', then
62 `"SystemId"'.
63
65 The following handlers and properties are supported by "XML::ESIS‐
66 Parser":
67
68 DocumentHandler methods
69
70 start_document
71 Receive notification of the beginning of a document.
72
73 No properties defined.
74
75 end_document
76 Receive notification of the end of a document.
77
78 No properties defined.
79
80 start_element
81 Receive notification of the beginning of an element.
82
83 Name The element type name.
84 Attributes A hash containing the attributes attached to the
85 element, if any.
86 IncludedSubelement This element is an included subelement.
87 Empty This element is declared empty.
88
89 The `"Attributes"' hash contains only string values. The `"Empty"'
90 flag is not set for an element that merely has no content, it is
91 set only if the DTD declares it empty.
92
93 BETA: Attribute values currently do not expand SData entities into
94 entity objects, they are still in the system data notation used by
95 nsgmls (inside `⎪'). A future version of XML::ESISParser will also
96 convert other types of attributes into their respective objects,
97 currently just their notation or entity names are given.
98
99 end_element
100 Receive notification of the end of an element.
101
102 Name The element type name.
103
104 characters
105 Receive notification of character data.
106
107 Data The characters from the document.
108
109 record_end
110 Receive notification of a record end sequence. XML applications
111 should convert this to a new-line.
112
113 processing_instruction
114 Receive notification of a processing instruction.
115
116 Target The processing instruction target in XML.
117 Data The processing instruction data, if any.
118
119 internal_entity_ref
120 Receive notification of a system data (SData) internal entity ref‐
121 erence.
122
123 Name The name of the internal entity reference.
124
125 external_entity_ref
126 Receive notification of a external entity reference.
127
128 Name The name of the external entity reference.
129
130 start_subdoc
131 Receive notification of the start of a sub document.
132
133 Name The name of the external entity reference.
134
135 end_subdoc
136 Receive notification of the end of a sub document.
137
138 Name The name of the external entity reference.
139
140 conforming
141 Receive notification that the document just parsed conforms to it's
142 document type declaration (DTD).
143
144 No properties defined.
145
146 DTDHandler methods
147
148 external_entity_decl
149 Receive notification of an external entity declaration.
150
151 Name The entity's entity name.
152 Type The entity's type (CDATA, NDATA, etc.)
153 SystemId The entity's system identifier.
154 PublicId The entity's public identifier, if any.
155 GeneratedId Generated system identifiers, if any.
156
157 internal_entity_decl
158 Receive notification of an internal entity declaration.
159
160 Name The entity's entity name.
161 Type The entity's type (CDATA, NDATA, etc.)
162 Value The entity's character value.
163
164 notation_decl
165 Receive notification of a notation declaration.
166
167 Name The notation's name.
168 SystemId The notation's system identifier.
169 PublicId The notation's public identifier, if any.
170 GeneratedId Generated system identifiers, if any.
171
172 subdoc_entity_decl
173 Receive notification of a subdocument entity declaration.
174
175 Name The entity's entity name.
176 SystemId The entity's system identifier.
177 PublicId The entity's public identifier, if any.
178 GeneratedId Generated system identifiers, if any.
179
180 external_sgml_entity_decl
181 Receive notification of an external SGML-entity declaration.
182
183 Name The entity's entity name.
184 SystemId The entity's system identifier.
185 PublicId The entity's public identifier, if any.
186 GeneratedId Generated system identifiers, if any.
187
189 Ken MacLeod, ken@bitsko.slc.ut.us
190
192 perl(1), PerlSAX.pod(3)
193
194 Extensible Markup Language (XML) <http://www.w3c.org/XML/>
195 SAX 1.0: The Simple API for XML <http://www.megginson.com/SAX/>
196 SGML Parser (SP) <http://www.jclark.com/sp/>
197
198
199
200perl v5.8.8 2003-10-21 XML::ESISParser(3)