PageRenderTime 46ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/.metadata/.plugins/org.eclipse.php.core/__language__/3a86f0e4/xml.php

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