Debian Codegraph @

codelitephp/resources/cc/xml.php

raw
1 <?php
2
3 // Start of xml v.
4
5 /**
6 * Create an XML parser
7 * @link http://www.php.net/manual/en/function.xml-parser-create.php
8 * @param encoding string[optional] <p>
9 * The optional encoding specifies the character
10 * encoding for the input/output in PHP 4. Starting from PHP 5, the input
11 * encoding is automatically detected, so that the
12 * encoding parameter specifies only the output
13 * encoding. In PHP 4, the default output encoding is the same as the
14 * input charset. If empty string is passed, the parser attempts to identify
15 * which encoding the document is encoded in by looking at the heading 3 or
16 * 4 bytes. In PHP 5.0.0 and 5.0.1, the default output charset is
17 * ISO-8859-1, while in PHP 5.0.2 and upper is UTF-8. The supported
18 * encodings are ISO-8859-1, UTF-8 and
19 * US-ASCII.
20 * </p>
21 * @return resource a resource handle for the new XML parser.
22 */
23 function xml_parser_create ($encoding = null) {}
24
25 /**
26 * Create an XML parser with namespace support
27 * @link http://www.php.net/manual/en/function.xml-parser-create-ns.php
28 * @param encoding string[optional] <p>
29 * The optional encoding specifies the character
30 * encoding for the input/output in PHP 4. Starting from PHP 5, the input
31 * encoding is automatically detected, so that the
32 * encoding parameter specifies only the output
33 * encoding. In PHP 4, the default output encoding is the same as the
34 * input charset. In PHP 5.0.0 and 5.0.1, the default output charset is
35 * ISO-8859-1, while in PHP 5.0.2 and upper is UTF-8. The supported
36 * encodings are ISO-8859-1, UTF-8 and
37 * US-ASCII.
38 * </p>
39 * @param separator string[optional] <p>
40 * With a namespace aware parser tag parameters passed to the various
41 * handler functions will consist of namespace and tag name separated by
42 * the string specified in separator.
43 * </p>
44 * @return resource a resource handle for the new XML parser.
45 */
46 function xml_parser_create_ns ($encoding = null, $separator = null) {}
47
48 /**
49 * Use XML Parser within an object
50 * @link http://www.php.net/manual/en/function.xml-set-object.php
51 * @param parser resource <p>
52 * A reference to the XML parser to use inside the object.
53 * </p>
54 * @param object object <p>
55 * The object where to use the XML parser.
56 * </p>
57 * @return bool Returns true on success, false on failure.
58 */
59 function xml_set_object ($parser, &$object) {}
60
61 /**
62 * Set up start and end element handlers
63 * @link http://www.php.net/manual/en/function.xml-set-element-handler.php
64 * @param parser resource <p>
65 * A reference to the XML parser to set up start and end element handler functions.
66 * </p>
67 * @param start_element_handler callable <p>
68 * The function named by start_element_handler
69 * must accept three parameters:
70 *
71 * start_element_handler
72 * resourceparser
73 * stringname
74 * arrayattribs
75 *
76 *
77 *
78 * parser
79 *
80 *
81 * The first parameter, parser, is a
82 * reference to the XML parser calling the handler.
83 * @param end_element_handler callable <p>
84 * The function named by end_element_handler
85 * must accept two parameters:
86 *
87 * end_element_handler
88 * resourceparser
89 * stringname
90 *
91 *
92 *
93 * parser
94 *
95 *
96 * The first parameter, parser, is a
97 * reference to the XML parser calling the handler.
98 * @return bool Returns true on success, false on failure.
99 */
100 function xml_set_element_handler ($parser, $start_element_handler, $end_element_handler) {}
101
102 /**
103 * Set up character data handler
104 * @link http://www.php.net/manual/en/function.xml-set-character-data-handler.php
105 * @param parser resource <p>
106 * A reference to the XML parser to set up character data handler function.
107 * </p>
108 * @param handler callable <p>
109 * handler is a string containing the name of a
110 * function that must exist when xml_parse is called
111 * for parser.
112 * </p>
113 * <p>
114 * The function named by handler must accept
115 * two parameters:
116 *
117 * handler
118 * resourceparser
119 * stringdata
120 *
121 *
122 *
123 * parser
124 *
125 *
126 * The first parameter, parser, is a
127 * reference to the XML parser calling the handler.
128 * @return bool Returns true on success, false on failure.
129 */
130 function xml_set_character_data_handler ($parser, $handler) {}
131
132 /**
133 * Set up processing instruction (PI) handler
134 * @link http://www.php.net/manual/en/function.xml-set-processing-instruction-handler.php
135 * @param parser resource <p>
136 * A reference to the XML parser to set up processing instruction (PI) handler function.
137 * </p>
138 * @param handler callable <p>
139 * handler is a string containing the name of a
140 * function that must exist when xml_parse is called
141 * for parser.
142 * </p>
143 * <p>
144 * The function named by handler must accept
145 * three parameters:
146 *
147 * handler
148 * resourceparser
149 * stringtarget
150 * stringdata
151 *
152 *
153 *
154 * parser
155 *
156 *
157 * The first parameter, parser, is a
158 * reference to the XML parser calling the handler.
159 * @return bool Returns true on success, false on failure.
160 */
161 function xml_set_processing_instruction_handler ($parser, $handler) {}
162
163 /**
164 * Set up default handler
165 * @link http://www.php.net/manual/en/function.xml-set-default-handler.php
166 * @param parser resource <p>
167 * A reference to the XML parser to set up default handler function.
168 * </p>
169 * @param handler callable <p>
170 * handler is a string containing the name of a
171 * function that must exist when xml_parse is called
172 * for parser.
173 * </p>
174 * <p>
175 * The function named by handler must accept
176 * two parameters:
177 *
178 * handler
179 * resourceparser
180 * stringdata
181 *
182 *
183 *
184 *
185 * parser
186 *
187 *
188 *
189 * The first parameter, parser, is a
190 * reference to the XML parser calling the handler.
191 * @return bool Returns true on success, false on failure.
192 */
193 function xml_set_default_handler ($parser, $handler) {}
194
195 /**
196 * Set up unparsed entity declaration handler
197 * @link http://www.php.net/manual/en/function.xml-set-unparsed-entity-decl-handler.php
198 * @param parser resource <p>
199 * A reference to the XML parser to set up unparsed entity declaration handler function.
200 * </p>
201 * @param handler callable <p>
202 * handler is a string containing the name of a
203 * function that must exist when xml_parse is called
204 * for parser.
205 * </p>
206 * <p>
207 * The function named by handler must accept six
208 * parameters:
209 *
210 * handler
211 * resourceparser
212 * stringentity_name
213 * stringbase
214 * stringsystem_id
215 * stringpublic_id
216 * stringnotation_name
217 *
218 *
219 *
220 * parser
221 *
222 *
223 * The first parameter, parser, is a
224 * reference to the XML parser calling the
225 * handler.
226 * @return bool Returns true on success, false on failure.
227 */
228 function xml_set_unparsed_entity_decl_handler ($parser, $handler) {}
229
230 /**
231 * Set up notation declaration handler
232 * @link http://www.php.net/manual/en/function.xml-set-notation-decl-handler.php
233 * @param parser resource <p>
234 * A reference to the XML parser to set up notation declaration handler function.
235 * </p>
236 * @param handler callable <p>
237 * handler is a string containing the name of a
238 * function that must exist when xml_parse is called
239 * for parser.
240 * </p>
241 * <p>
242 * The function named by handler must accept
243 * five parameters:
244 *
245 * handler
246 * resourceparser
247 * stringnotation_name
248 * stringbase
249 * stringsystem_id
250 * stringpublic_id
251 *
252 *
253 *
254 *
255 * parser
256 *
257 *
258 *
259 * The first parameter, parser, is a
260 * reference to the XML parser calling the handler.
261 * @return bool Returns true on success, false on failure.
262 */
263 function xml_set_notation_decl_handler ($parser, $handler) {}
264
265 /**
266 * Set up external entity reference handler
267 * @link http://www.php.net/manual/en/function.xml-set-external-entity-ref-handler.php
268 * @param parser resource <p>
269 * A reference to the XML parser to set up external entity reference handler function.
270 * </p>
271 * @param handler callable <p>
272 * handler is a string containing the name of a
273 * function that must exist when xml_parse is called
274 * for parser.
275 * </p>
276 * <p>
277 * The function named by handler must accept
278 * five parameters, and should return an integer value.If the
279 * value returned from the handler is false (which it will be if no
280 * value is returned), the XML parser will stop parsing and
281 * xml_get_error_code will return
282 * XML_ERROR_EXTERNAL_ENTITY_HANDLING.
283 *
284 * handler
285 * resourceparser
286 * stringopen_entity_names
287 * stringbase
288 * stringsystem_id
289 * stringpublic_id
290 *
291 *
292 *
293 * parser
294 *
295 *
296 * The first parameter, parser, is a
297 * reference to the XML parser calling the handler.
298 * @return bool Returns true on success, false on failure.
299 */
300 function xml_set_external_entity_ref_handler ($parser, $handler) {}
301
302 /**
303 * Set up start namespace declaration handler
304 * @link http://www.php.net/manual/en/function.xml-set-start-namespace-decl-handler.php
305 * @param parser resource <p>
306 * A reference to the XML parser.
307 * </p>
308 * @param handler callable <p>
309 * handler is a string containing the name of a
310 * function that must exist when xml_parse is called
311 * for parser.
312 * </p>
313 * <p>
314 * The function named by handler must accept
315 * three parameters, and should return an integer value. If the
316 * value returned from the handler is false (which it will be if no
317 * value is returned), the XML parser will stop parsing and
318 * xml_get_error_code will return
319 * XML_ERROR_EXTERNAL_ENTITY_HANDLING.
320 *
321 * handler
322 * resourceparser
323 * stringprefix
324 * stringuri
325 *
326 *
327 *
328 * parser
329 *
330 *
331 * The first parameter, parser, is a
332 * reference to the XML parser calling the handler.
333 * @return bool Returns true on success, false on failure.
334 */
335 function xml_set_start_namespace_decl_handler ($parser, $handler) {}
336
337 /**
338 * Set up end namespace declaration handler
339 * @link http://www.php.net/manual/en/function.xml-set-end-namespace-decl-handler.php
340 * @param parser resource <p>
341 * A reference to the XML parser.
342 * </p>
343 * @param handler callable <p>
344 * handler is a string containing the name of a
345 * function that must exist when xml_parse is called
346 * for parser.
347 * </p>
348 * <p>
349 * The function named by handler must accept
350 * two parameters, and should return an integer value. If the
351 * value returned from the handler is false (which it will be if no
352 * value is returned), the XML parser will stop parsing and
353 * xml_get_error_code will return
354 * XML_ERROR_EXTERNAL_ENTITY_HANDLING.
355 *
356 * handler
357 * resourceparser
358 * stringprefix
359 *
360 *
361 *
362 * parser
363 *
364 *
365 * The first parameter, parser, is a
366 * reference to the XML parser calling the handler.
367 * @return bool Returns true on success, false on failure.
368 */
369 function xml_set_end_namespace_decl_handler ($parser, $handler) {}
370
371 /**
372 * Start parsing an XML document
373 * @link http://www.php.net/manual/en/function.xml-parse.php
374 * @param parser resource <p>
375 * A reference to the XML parser to use.
376 * </p>
377 * @param data string <p>
378 * Chunk of data to parse. A document may be parsed piece-wise by
379 * calling xml_parse several times with new data,
380 * as long as the is_final parameter is set and
381 * true when the last data is parsed.
382 * </p>
383 * @param is_final bool[optional] <p>
384 * If set and true, data is the last piece of
385 * data sent in this parse.
386 * </p>
387 * @return int 1 on success or 0 on failure.
388 * </p>
389 * <p>
390 * For unsuccessful parses, error information can be retrieved with
391 * xml_get_error_code,
392 * xml_error_string,
393 * xml_get_current_line_number,
394 * xml_get_current_column_number and
395 * xml_get_current_byte_index.
396 * </p>
397 *
398 * <p>
399 * Entity errors are reported at the end of the data thus only if
400 * is_final is set and true.
401 */
402 function xml_parse ($parser, $data, $is_final = null) {}
403
404 /**
405 * Parse XML data into an array structure
406 * @link http://www.php.net/manual/en/function.xml-parse-into-struct.php
407 * @param parser resource <p>
408 * A reference to the XML parser.
409 * </p>
410 * @param data string <p>
411 * A string containing the XML data.
412 * </p>
413 * @param values array <p>
414 * An array containing the values of the XML data
415 * </p>
416 * @param index array[optional] <p>
417 * An array containing pointers to the location of the appropriate values in the $values.
418 * </p>
419 * @return int xml_parse_into_struct returns 0 for failure and 1 for
420 * success. This is not the same as false and true, be careful with
421 * operators such as ===.
422 */
423 function xml_parse_into_struct ($parser, $data, array &$values, array &$index = null) {}
424
425 /**
426 * Get XML parser error code
427 * @link http://www.php.net/manual/en/function.xml-get-error-code.php
428 * @param parser resource <p>
429 * A reference to the XML parser to get error code from.
430 * </p>
431 * @return int This function returns false if parser does
432 * not refer to a valid parser, or else it returns one of the error
433 * codes listed in the error codes
434 * section.
435 */
436 function xml_get_error_code ($parser) {}
437
438 /**
439 * Get XML parser error string
440 * @link http://www.php.net/manual/en/function.xml-error-string.php
441 * @param code int <p>
442 * An error code from xml_get_error_code.
443 * </p>
444 * @return string a string with a textual description of the error
445 * code, or false if no description was found.
446 */
447 function xml_error_string ($code) {}
448
449 /**
450 * Get current line number for an XML parser
451 * @link http://www.php.net/manual/en/function.xml-get-current-line-number.php
452 * @param parser resource <p>
453 * A reference to the XML parser to get line number from.
454 * </p>
455 * @return int This function returns false if parser does
456 * not refer to a valid parser, or else it returns which line the
457 * parser is currently at in its data buffer.
458 */
459 function xml_get_current_line_number ($parser) {}
460
461 /**
462 * Get current column number for an XML parser
463 * @link http://www.php.net/manual/en/function.xml-get-current-column-number.php
464 * @param parser resource <p>
465 * A reference to the XML parser to get column number from.
466 * </p>
467 * @return int This function returns false if parser does
468 * not refer to a valid parser, or else it returns which column on
469 * the current line (as given by
470 * xml_get_current_line_number) the parser is
471 * currently at.
472 */
473 function xml_get_current_column_number ($parser) {}
474
475 /**
476 * Get current byte index for an XML parser
477 * @link http://www.php.net/manual/en/function.xml-get-current-byte-index.php
478 * @param parser resource <p>
479 * A reference to the XML parser to get byte index from.
480 * </p>
481 * @return int This function returns false if parser does
482 * not refer to a valid parser, or else it returns which byte index
483 * the parser is currently at in its data buffer (starting at 0).
484 */
485 function xml_get_current_byte_index ($parser) {}
486
487 /**
488 * Free an XML parser
489 * @link http://www.php.net/manual/en/function.xml-parser-free.php
490 * @param parser resource A reference to the XML parser to free.
491 * @return bool This function returns false if parser does not
492 * refer to a valid parser, or else it frees the parser and returns true.
493 */
494 function xml_parser_free ($parser) {}
495
496 /**
497 * Set options in an XML parser
498 * @link http://www.php.net/manual/en/function.xml-parser-set-option.php
499 * @param parser resource <p>
500 * A reference to the XML parser to set an option in.
501 * </p>
502 * @param option int <p>
503 * Which option to set. See below.
504 * </p>
505 * <p>
506 * The following options are available:
507 * <table>
508 * XML parser options
509 *
510 *
511 * <tr valign="top">
512 * <td>Option constant</td>
513 * <td>Data type</td>
514 * <td>Description</td>
515 * </tr>
516 *
517 *
518 * <tr valign="top">
519 * <td>XML_OPTION_CASE_FOLDING</td>
520 * <td>integer</td>
521 * <td>
522 * Controls whether case-folding is enabled for this
523 * XML parser. Enabled by default.
524 * </td>
525 * </tr>
526 * <tr valign="top">
527 * <td>XML_OPTION_SKIP_TAGSTART</td>
528 * <td>integer</td>
529 * <td>
530 * Specify how many characters should be skipped in the beginning of a
531 * tag name.
532 * </td>
533 * </tr>
534 * <tr valign="top">
535 * <td>XML_OPTION_SKIP_WHITE</td>
536 * <td>integer</td>
537 * <td>
538 * Whether to skip values consisting of whitespace characters.
539 * </td>
540 * </tr>
541 * <tr valign="top">
542 * <td>XML_OPTION_TARGET_ENCODING</td>
543 * <td>string</td>
544 * <td>
545 * Sets which target encoding to
546 * use in this XML parser.By default, it is set to the same as the
547 * source encoding used by xml_parser_create.
548 * Supported target encodings are ISO-8859-1,
549 * US-ASCII and UTF-8.
550 * </td>
551 * </tr>
552 *
553 *
554 * </table>
555 * </p>
556 * @param value mixed <p>
557 * The option's new value.
558 * </p>
559 * @return bool This function returns false if parser does not
560 * refer to a valid parser, or if the option could not be set. Else the
561 * option is set and true is returned.
562 */
563 function xml_parser_set_option ($parser, $option, $value) {}
564
565 /**
566 * Get options from an XML parser
567 * @link http://www.php.net/manual/en/function.xml-parser-get-option.php
568 * @param parser resource A reference to the XML parser to get an option from.
569 * @param option int Which option to fetch. XML_OPTION_CASE_FOLDING
570 * and XML_OPTION_TARGET_ENCODING are available.
571 * See xml_parser_set_option for their description.
572 * @return mixed This function returns false if parser does
573 * not refer to a valid parser or if option isn't
574 * valid (generates also a E_WARNING).
575 * Else the option's value is returned.
576 */
577 function xml_parser_get_option ($parser, $option) {}
578
579 /**
580 * Encodes an ISO-8859-1 string to UTF-8
581 * @link http://www.php.net/manual/en/function.utf8-encode.php
582 * @param data string <p>
583 * An ISO-8859-1 string.
584 * </p>
585 * @return string the UTF-8 translation of data.
586 */
587 function utf8_encode ($data) {}
588
589 /**
590 * Converts a string with ISO-8859-1 characters encoded with UTF-8
591 to single-byte ISO-8859-1
592 * @link http://www.php.net/manual/en/function.utf8-decode.php
593 * @param data string <p>
594 * An UTF-8 encoded string.
595 * </p>
596 * @return string the ISO-8859-1 translation of data.
597 */
598 function utf8_decode ($data) {}
599
600 define ('XML_ERROR_NONE', 0);
601 define ('XML_ERROR_NO_MEMORY', 1);
602 define ('XML_ERROR_SYNTAX', 2);
603 define ('XML_ERROR_NO_ELEMENTS', 3);
604 define ('XML_ERROR_INVALID_TOKEN', 4);
605 define ('XML_ERROR_UNCLOSED_TOKEN', 5);
606 define ('XML_ERROR_PARTIAL_CHAR', 6);
607 define ('XML_ERROR_TAG_MISMATCH', 7);
608 define ('XML_ERROR_DUPLICATE_ATTRIBUTE', 8);
609 define ('XML_ERROR_JUNK_AFTER_DOC_ELEMENT', 9);
610 define ('XML_ERROR_PARAM_ENTITY_REF', 10);
611 define ('XML_ERROR_UNDEFINED_ENTITY', 11);
612 define ('XML_ERROR_RECURSIVE_ENTITY_REF', 12);
613 define ('XML_ERROR_ASYNC_ENTITY', 13);
614 define ('XML_ERROR_BAD_CHAR_REF', 14);
615 define ('XML_ERROR_BINARY_ENTITY_REF', 15);
616 define ('XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF', 16);
617 define ('XML_ERROR_MISPLACED_XML_PI', 17);
618 define ('XML_ERROR_UNKNOWN_ENCODING', 18);
619 define ('XML_ERROR_INCORRECT_ENCODING', 19);
620 define ('XML_ERROR_UNCLOSED_CDATA_SECTION', 20);
621 define ('XML_ERROR_EXTERNAL_ENTITY_HANDLING', 21);
622 define ('XML_OPTION_CASE_FOLDING', 1);
623 define ('XML_OPTION_TARGET_ENCODING', 2);
624 define ('XML_OPTION_SKIP_TAGSTART', 3);
625 define ('XML_OPTION_SKIP_WHITE', 4);
626
627 /**
628 * Holds the SAX implementation method.
629 * Can be libxml or expat.
630 * @link http://www.php.net/manual/en/xml.constants.php
631 */
632 define ('XML_SAX_IMPL', "libxml");
633
634 // End of xml v.
635 ?>