PageRenderTime 40ms CodeModel.GetById 11ms RepoModel.GetById 1ms app.codeStats 0ms

/hphp/runtime/ext/domdocument/ext_domdocument.php

http://github.com/facebook/hiphop-php
PHP | 1900 lines | 628 code | 218 blank | 1054 comment | 0 complexity | 4058b202f8bee19f00475b50e3c53676 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0

Large files files are truncated, but you can click here to view the full file

  1. <?hh // partial
  2. <<__NativeData("DOMNode")>>
  3. class DOMNode {
  4. public function __construct(): void {
  5. }
  6. /**
  7. * This functions appends a child to an existing list of children or creates
  8. * a new list of children. The child can be created with e.g.
  9. * DOMDocument::createElement(), DOMDocument::createTextNode() etc. or
  10. * simply by using any other node.
  11. *
  12. * @param DOMNode $newnode - The appended child.
  13. *
  14. * @return mixed - The node added.
  15. *
  16. */
  17. <<__Native>>
  18. public function appendChild(DOMNode $newnode): mixed;
  19. /**
  20. * Creates a copy of the node.
  21. *
  22. * @param bool $deep - Indicates whether to copy all descendant nodes. This
  23. * parameter is defaulted to FALSE.
  24. *
  25. * @return mixed - The cloned node.
  26. *
  27. */
  28. <<__Native>>
  29. public function cloneNode(bool $deep = false): mixed;
  30. /**
  31. * Gets line number for where the node is defined.
  32. *
  33. * @return int - Always returns the line number where the node was defined
  34. * in.
  35. *
  36. */
  37. <<__Native>>
  38. public function getLineNo(): int;
  39. /**
  40. * This method checks if the node has attributes. The tested node have to be
  41. * an XML_ELEMENT_NODE.
  42. *
  43. * @return bool - Returns TRUE on success or FALSE on failure.
  44. *
  45. */
  46. <<__Native>>
  47. public function hasAttributes(): bool;
  48. /**
  49. * This function checks if the node has children.
  50. *
  51. * @return bool - Returns TRUE on success or FALSE on failure.
  52. *
  53. */
  54. <<__Native>>
  55. public function hasChildNodes(): bool;
  56. /**
  57. * This function inserts a new node right before the reference node. If you
  58. * plan to do further modifications on the appended child you must use the
  59. * returned node.
  60. *
  61. * @param DOMNode $newnode - The new node.
  62. * @param DOMNode $refnode - The reference node. If not supplied, newnode is
  63. * appended to the children.
  64. *
  65. * @return mixed - The inserted node.
  66. *
  67. */
  68. <<__Native>>
  69. public function insertBefore(DOMNode $newnode, ?DOMNode $refnode = null): mixed;
  70. /**
  71. * Tells whether namespaceURI is the default namespace.
  72. *
  73. * @param string $namespaceuri - The namespace URI to look for.
  74. *
  75. * @return bool - Return TRUE if namespaceURI is the default namespace,
  76. * FALSE otherwise.
  77. *
  78. */
  79. <<__Native>>
  80. public function isDefaultNamespace(string $namespaceuri): bool;
  81. /**
  82. * This function indicates if two nodes are the same node. The comparison is
  83. * not based on content
  84. *
  85. * @param DOMNode $node - The compared node.
  86. *
  87. * @return bool - Returns TRUE on success or FALSE on failure.
  88. *
  89. */
  90. <<__Native>>
  91. public function isSameNode(DOMNode $node): bool;
  92. /**
  93. * Checks if the asked feature is supported for the specified version.
  94. *
  95. * @param string $feature - The feature to test. See the example of
  96. * DOMImplementation::hasFeature() for a list of features.
  97. *
  98. * @param string $version - The version number of the feature to test.
  99. *
  100. * @return bool - Returns TRUE on success or FALSE on failure.
  101. *
  102. */
  103. <<__Native>>
  104. public function isSupported(string $feature, string $version): bool;
  105. /**
  106. * Gets the namespace URI of the node based on the prefix.
  107. *
  108. * @param mixed $namespaceuri - The prefix of the namespace.
  109. *
  110. * @return mixed - The namespace URI of the node.
  111. *
  112. */
  113. <<__Native>>
  114. public function lookupNamespaceUri(mixed $namespaceuri): mixed;
  115. /**
  116. * Gets the namespace prefix of the node based on the namespace URI.
  117. *
  118. * @param string $prefix - The namespace URI.
  119. *
  120. * @return mixed - The prefix of the namespace.
  121. *
  122. */
  123. <<__Native>>
  124. public function lookupPrefix(string $prefix): mixed;
  125. /**
  126. * Normalizes the node.
  127. *
  128. */
  129. <<__Native>>
  130. public function normalize(): void;
  131. /**
  132. * This functions removes a child from a list of children.
  133. *
  134. * @param DOMNode $node - The removed child.
  135. *
  136. * @return mixed - If the child could be removed the functions returns the
  137. * old child.
  138. *
  139. */
  140. <<__Native>>
  141. public function removeChild(DOMNode $node): mixed;
  142. /**
  143. * This function replaces the child oldnode with the passed new node. If the
  144. * new node is already a child it will not be added a second time. If the
  145. * replacement succeeds the old node is returned.
  146. *
  147. * @param DOMNode $newchildobj - The new node. It must be a member of the
  148. * target document, i.e. created by one of the DOMDocument->createXXX()
  149. * methods or imported in the document by DOMDocument::importNode.
  150. * @param DOMNode $oldchildobj - The old node.
  151. *
  152. * @return mixed - The old node or FALSE if an error occur.
  153. *
  154. */
  155. <<__Native>>
  156. public function replaceChild(DOMNode $newchildobj, DOMNode $oldchildobj): mixed;
  157. <<__Native>>
  158. public function c14n(bool $exclusive = false,
  159. bool $with_comments = false,
  160. mixed $xpath = null,
  161. mixed $ns_prefixes = null): mixed;
  162. <<__Native>>
  163. public function c14nfile(string $uri,
  164. bool $exclusive = false,
  165. bool $with_comments = false,
  166. mixed $xpath = null,
  167. mixed $ns_prefixes = null): mixed;
  168. <<__Native>>
  169. public function getNodePath(): mixed;
  170. /**
  171. * @return array - var_dump() compat output helper.
  172. *
  173. */
  174. <<__Native>>
  175. public function __debuginfo(): array;
  176. }
  177. /**
  178. * DOMAttr represents an attribute in the DOMElement object.
  179. *
  180. */
  181. class DOMAttr extends DOMNode {
  182. <<__Native>>
  183. public function __construct(string $name, ?string $value = null): void;
  184. /**
  185. * This function checks if the attribute is a defined ID. According to the
  186. * DOM standard this requires a DTD which defines the attribute ID to be of
  187. * type ID. You need to validate your document with DOMDocument::validate or
  188. * DOMDocument::validateOnParse before using this function.
  189. *
  190. * @return bool - Returns TRUE on success or FALSE on failure.
  191. *
  192. */
  193. <<__Native>>
  194. public function isId(): bool;
  195. /**
  196. * @return array - var_dump() compat output helper.
  197. *
  198. */
  199. <<__Native>>
  200. public function __debuginfo(): array;
  201. }
  202. /**
  203. * Represents nodes with character data. No nodes directly correspond to this
  204. * class, but other nodes do inherit from it.
  205. *
  206. */
  207. class DOMCharacterData extends DOMNode {
  208. /**
  209. * Append the string data to the end of the character data of the node.
  210. *
  211. * @param string $arg - The string to append.
  212. *
  213. * @return bool - No value is returned.
  214. *
  215. */
  216. <<__Native>>
  217. public function appendData(string $arg): bool;
  218. /**
  219. * Deletes count characters starting from position offset.
  220. *
  221. * @param int $offset - The offset from which to start removing.
  222. * @param int $count - The number of characters to delete. If the sum of
  223. * offset and count exceeds the length, then all characters to the end of
  224. * the data are deleted.
  225. *
  226. * @return bool - No value is returned.
  227. *
  228. */
  229. <<__Native>>
  230. public function deleteData(int $offset, int $count): bool;
  231. /**
  232. * Inserts string data at position offset.
  233. *
  234. * @param int $offset - The character offset at which to insert.
  235. * @param string $data - The string to insert.
  236. *
  237. * @return bool - No value is returned.
  238. *
  239. */
  240. <<__Native>>
  241. public function insertData(int $offset, string $data): bool;
  242. /**
  243. * Replace count characters starting from position offset with data.
  244. *
  245. * @param int $offset - The offset from which to start replacing.
  246. * @param int $count - The number of characters to replace. If the sum of
  247. * offset and count exceeds the length, then all characters to the end of
  248. * the data are replaced.
  249. * @param string $data - The string with which the range must be replaced.
  250. *
  251. * @return bool - No value is returned.
  252. *
  253. */
  254. <<__Native>>
  255. public function replaceData(int $offset, int $count, string $data): bool;
  256. /**
  257. * Returns the specified substring.
  258. *
  259. * @param int $offset - Start offset of substring to extract.
  260. * @param int $count - The number of characters to extract.
  261. *
  262. * @return string - The specified substring. If the sum of offset and count
  263. * exceeds the length, then all 16-bit units to the end of the data are
  264. * returned.
  265. *
  266. */
  267. <<__Native>>
  268. public function substringData(int $offset, int $count): string;
  269. /**
  270. * @return array - var_dump() compat output helper.
  271. *
  272. */
  273. <<__Native>>
  274. public function __debuginfo(): array;
  275. }
  276. /**
  277. * Represents comment nodes, characters delimited by <!-- and -->.
  278. *
  279. */
  280. class DOMComment extends DOMCharacterData {
  281. <<__Native>>
  282. public function __construct(?string $value = null): void;
  283. }
  284. /**
  285. * The DOMText class inherits from DOMCharacterData and represents the textual
  286. * content of a DOMElement or DOMAttr.
  287. *
  288. */
  289. class DOMText extends DOMCharacterData {
  290. <<__Native>>
  291. public function __construct(?string $value = null): void;
  292. /**
  293. * Indicates whether this text node contains whitespace. The text node is
  294. * determined to contain whitespace in element content during the load of
  295. * the document.
  296. *
  297. * @return bool - Returns TRUE on success or FALSE on failure.
  298. *
  299. */
  300. <<__Native>>
  301. public function isWhitespaceInElementContent(): bool;
  302. /**
  303. * Indicates whether this text node contains whitespace. The text node is
  304. * determined to contain whitespace in element content during the load of
  305. * the document.
  306. *
  307. * @return bool - Returns TRUE on success or FALSE on failure.
  308. *
  309. */
  310. <<__Native>>
  311. public function isElementContentWhitespace(): bool;
  312. /**
  313. * Breaks this node into two nodes at the specified offset, keeping both in
  314. * the tree as siblings. After being split, this node will contain all the
  315. * content up to the offset. If the original node had a parent node, the new
  316. * node is inserted as the next sibling of the original node. When the
  317. * offset is equal to the length of this node, the new node has no data.
  318. *
  319. * @param int $offset - The offset at which to split, starting from 0.
  320. *
  321. * @return mixed - The new node of the same type, which contains all the
  322. * content at and after the offset.
  323. *
  324. */
  325. <<__Native>>
  326. public function splitText(int $offset): mixed;
  327. /**
  328. * @return array - var_dump() compat output helper.
  329. *
  330. */
  331. <<__Native>>
  332. public function __debuginfo(): array;
  333. }
  334. class DOMCdataSection extends DOMText {
  335. <<__Native>>
  336. public function __construct(string $value): void;
  337. }
  338. /**
  339. * Represents an entire HTML or XML document; serves as the root of the
  340. * document tree.
  341. *
  342. */
  343. class DOMDocument extends DOMNode {
  344. <<__Native>>
  345. public function __construct(?string $version = null, ?string $encoding = null): void;
  346. /**
  347. * This function creates a new instance of class DOMAttr. This node will not
  348. * show up in the document unless it is inserted with (e.g.)
  349. * DOMNode->appendChild().
  350. *
  351. * @param string $name - The name of the attribute.
  352. *
  353. * @return mixed - The new DOMAttr or FALSE if an error occurred.
  354. *
  355. */
  356. <<__Native>>
  357. public function createAttribute(string $name): mixed;
  358. /**
  359. * This function creates a new instance of class DOMAttr. This node will not
  360. * show up in the document unless it is inserted with (e.g.)
  361. * DOMNode->appendChild().
  362. *
  363. * @param string $namespaceuri - The URI of the namespace.
  364. * @param string $qualifiedname - The tag name and prefix of the attribute,
  365. * as prefix:tagname.
  366. *
  367. * @return mixed - The new DOMAttr or FALSE if an error occurred.
  368. *
  369. */
  370. <<__Native>>
  371. public function createAttributeNS(string $namespaceuri,
  372. string $qualifiedname): mixed;
  373. /**
  374. * This function creates a new instance of class DOMCDATASection. This node
  375. * will not show up in the document unless it is inserted with (e.g.)
  376. * DOMNode->appendChild().
  377. *
  378. * @param string $data - The content of the cdata.
  379. *
  380. * @return mixed - The new DOMCDATASection or FALSE if an error occurred.
  381. *
  382. */
  383. <<__Native>>
  384. public function createCDATASection(string $data): mixed;
  385. /**
  386. * This function creates a new instance of class DOMComment. This node will
  387. * not show up in the document unless it is inserted with (e.g.)
  388. * DOMNode->appendChild().
  389. *
  390. * @param string $data - The content of the comment.
  391. *
  392. * @return mixed - The new DOMComment or FALSE if an error occurred.
  393. *
  394. */
  395. <<__Native>>
  396. public function createComment(string $data): mixed;
  397. /**
  398. * This function creates a new instance of class DOMDocumentFragment. This
  399. * node will not show up in the document unless it is inserted with (e.g.)
  400. * DOMNode->appendChild().
  401. *
  402. * @return mixed - The new DOMDocumentFragment or FALSE if an error occurred.
  403. *
  404. */
  405. <<__Native>>
  406. public function createDocumentFragment(): mixed;
  407. /**
  408. * This function creates a new instance of class DOMElement. This node will
  409. * not show up in the document unless it is inserted with (e.g.)
  410. * DOMNode->appendChild().
  411. *
  412. * @param string $name - The tag name of the element.
  413. * @param string $value - The value of the element. By default, an empty
  414. * element will be created. The value can also be set later with
  415. * DOMElement->nodeValue.
  416. *
  417. * @return mixed - Returns a new instance of class DOMElement or FALSE if an
  418. * error occurred.
  419. *
  420. */
  421. <<__Native>>
  422. public function createElement(string $name, ?string $value = null): mixed;
  423. /**
  424. * This function creates a new element node with an associated namespace.
  425. * This node will not show up in the document unless it is inserted with
  426. * (e.g.) DOMNode->appendChild().
  427. *
  428. * @param string $namespaceuri - The URI of the namespace.
  429. * @param string $qualifiedname - The qualified name of the element, as
  430. * prefix:tagname.
  431. * @param string $value - The value of the element. By default, an empty
  432. * element will be created. You can also set the value later with
  433. * DOMElement->nodeValue.
  434. *
  435. * @return mixed - The new DOMElement or FALSE if an error occurred.
  436. *
  437. */
  438. <<__Native>>
  439. public function createElementNS(string $namespaceuri,
  440. string $qualifiedname,
  441. ?string $value = null): mixed;
  442. /**
  443. * This function creates a new instance of class DOMEntityReference. This
  444. * node will not show up in the document unless it is inserted with (e.g.)
  445. * DOMNode->appendChild().
  446. *
  447. * @param string $name - The content of the entity reference, e.g. the
  448. * entity reference minus the leading & and the trailing ; characters.
  449. *
  450. * @return mixed - The new DOMEntityReference or FALSE if an error occurred.
  451. *
  452. */
  453. <<__Native>>
  454. public function createEntityReference(string $name): mixed;
  455. /**
  456. * This function creates a new instance of class DOMProcessingInstruction.
  457. * This node will not show up in the document unless it is inserted with
  458. * (e.g.) DOMNode->appendChild().
  459. *
  460. * @param string $target - The target of the processing instruction.
  461. * @param string $data - The content of the processing instruction.
  462. *
  463. * @return mixed - The new DOMProcessingInstruction or FALSE if an error
  464. * occurred.
  465. *
  466. */
  467. <<__Native>>
  468. public function createProcessingInstruction(string $target,
  469. ?string $data = null): mixed;
  470. /**
  471. * This function creates a new instance of class DOMText. This node will not
  472. * show up in the document unless it is inserted with (e.g.)
  473. * DOMNode->appendChild().
  474. *
  475. * @param string $data - The content of the text.
  476. *
  477. * @return mixed - The new DOMText or FALSE if an error occurred.
  478. *
  479. */
  480. <<__Native>>
  481. public function createTextNode(string $data): mixed;
  482. /**
  483. * This function is similar to DOMDocument::getElementsByTagName but
  484. * searches for an element with a given id. For this function to work, you
  485. * will need either to set some ID attributes with
  486. * DOMElement::setIdAttribute or a DTD which defines an attribute to be of
  487. * type ID. In the later case, you will need to validate your document with
  488. * DOMDocument::validate or DOMDocument->validateOnParse before using this
  489. * function.
  490. *
  491. * @param string $elementid - The unique id value for an element.
  492. *
  493. * @return mixed - Returns the DOMElement or NULL if the element is not
  494. * found.
  495. *
  496. */
  497. <<__Native>>
  498. public function getElementById(string $elementid): mixed;
  499. /**
  500. * This function returns a new instance of class DOMNodeList containing the
  501. * elements with a given tag name.
  502. *
  503. * @param string $name - The name of the tag to match on. The special value
  504. * * matches all tags.
  505. *
  506. * @return mixed - A new DOMNodeList object containing all the matched
  507. * elements.
  508. *
  509. */
  510. <<__Native>>
  511. public function getElementsByTagName(string $name): mixed;
  512. /**
  513. * Returns a DOMNodeList of all elements with a given local name and a
  514. * namespace URI.
  515. *
  516. * @param string $namespaceuri - The namespace URI of the elements to match
  517. * on. The special value * matches all namespaces.
  518. * @param string $localname - The local name of the elements to match on.
  519. * The special value * matches all local names.
  520. *
  521. * @return mixed - A new DOMNodeList object containing all the matched
  522. * elements.
  523. *
  524. */
  525. <<__Native>>
  526. public function getElementsByTagNameNS(string $namespaceuri,
  527. string $localname): mixed;
  528. /**
  529. * This function returns a copy of the node to import and associates it with
  530. * the current document.
  531. *
  532. * @param DOMNode $importednode - The node to import.
  533. * @param bool $deep - If set to TRUE, this method will recursively import
  534. * the subtree under the importedNode. To copy the nodes attributes deep
  535. * needs to be set to TRUE
  536. *
  537. * @return mixed - The copied node or FALSE, if it cannot be copied.
  538. *
  539. */
  540. <<__Native>>
  541. public function importNode(DOMNode $importednode, bool $deep = false): mixed;
  542. /**
  543. * Internal helper function for load()/loadXML()
  544. */
  545. <<__Native>>
  546. private function _load(string $arg, int $options,
  547. bool $isFile): bool;
  548. /**
  549. * Internal helper function for loadHTMLFile()/loadHTML()
  550. */
  551. <<__Native>>
  552. private function _loadHTML(string $arg, int $options,
  553. bool $isFile): bool;
  554. /**
  555. * Loads an XML document from a file. Warning Unix style paths with forward
  556. * slashes can cause significant performance degradation on Windows systems;
  557. * be sure to call realpath() in such a case.
  558. *
  559. * @param string $filename - The path to the XML document.
  560. * @param int $options - Bitwise OR of the libxml option constants.
  561. *
  562. * @return bool - Returns TRUE on success or FALSE on failure.
  563. */
  564. public function load($filename, $options = 0): bool {
  565. return $this->_load($filename, $options, true);
  566. }
  567. /**
  568. * The function parses the HTML contained in the string source. Unlike
  569. * loading XML, HTML does not have to be well-formed to load.
  570. *
  571. * @param string $source - The HTML string.
  572. * @param int $options - Since PHP 5.4.0 and libxml 2.6.0, you may also use
  573. * the options parameter to specify additional Libxml parameters
  574. *
  575. * @return bool - Returns TRUE on success or FALSE on failure.
  576. */
  577. public function loadHTML($source, $options = 0): bool {
  578. return $this->_loadHTML($source, $options, false);
  579. }
  580. /**
  581. * The function parses the HTML document in the file named filename. Unlike
  582. * loading XML, HTML does not have to be well-formed to load.
  583. *
  584. * @param string $filename - The path to the HTML file.
  585. * @param int $options - Since PHP 5.4.0 and libxml 2.6.0, you may also use
  586. * the options parameter to specify additional Libxml parameters
  587. *
  588. * @return bool - Returns TRUE on success or FALSE on failure.
  589. */
  590. public function loadHTMLFile($filename, $options = 0): bool {
  591. return $this->_loadHTML($filename, $options, true);
  592. }
  593. /**
  594. * Loads an XML document from a string.
  595. *
  596. * @param string $source - The string containing the XML.
  597. * @param int $options - Bitwise OR of the libxml option constants.
  598. *
  599. * @return bool - Returns TRUE on success or FALSE on failure.
  600. */
  601. public function loadXML($source, $options = 0): bool {
  602. return $this->_load($source, $options, false);
  603. }
  604. /**
  605. * This method acts as if you saved and then loaded the document, putting
  606. * the document in a "normal" form.
  607. *
  608. */
  609. <<__Native>>
  610. public function normalizeDocument(): void;
  611. /**
  612. * This method allows you to register your own extended DOM class to be used
  613. * afterward by the PHP DOM extension. This method is not part of the DOM
  614. * standard.
  615. *
  616. * @param string $baseclass - The DOM class that you want to extend. You can
  617. * find a list of these classes in the chapter introduction.
  618. * @param string $extendedclass - Your extended class name. If NULL is
  619. * provided, any previously registered class extending baseclass will be
  620. * removed.
  621. *
  622. * @return bool - Returns TRUE on success or FALSE on failure.
  623. *
  624. */
  625. <<__Native>>
  626. public function registerNodeClass(string $baseclass, string $extendedclass): bool;
  627. /**
  628. * @param string $filename - The RNG file.
  629. *
  630. * @return bool - Returns TRUE on success or FALSE on failure.
  631. *
  632. */
  633. <<__Native>>
  634. public function relaxNGValidate(string $filename): bool;
  635. /**
  636. * @param string $source - A string containing the RNG schema.
  637. *
  638. * @return bool - Returns TRUE on success or FALSE on failure.
  639. *
  640. */
  641. <<__Native>>
  642. public function relaxNGValidateSource(string $source): bool;
  643. /**
  644. * Creates an XML document from the DOM representation. This function is
  645. * usually called after building a new dom document from scratch as in the
  646. * example below.
  647. *
  648. * @param string $file - The path to the saved XML document.
  649. * @param int $options - Additional Options. Currently only
  650. * LIBXML_NOEMPTYTAG is supported.
  651. *
  652. * @return mixed - Returns the number of bytes written or FALSE if an error
  653. * occurred.
  654. *
  655. */
  656. <<__Native>>
  657. public function save(string $file, int $options = 0): mixed;
  658. /**
  659. * Creates an HTML document from the DOM representation. This function is
  660. * usually called after building a new dom document from scratch as in the
  661. * example below.
  662. *
  663. * @param object $node - Optional parameter to output a subset of the
  664. * document.
  665. *
  666. * @return mixed - Returns the HTML, or FALSE if an error occurred.
  667. *
  668. */
  669. <<__Native>>
  670. public function saveHTML(?DOMNode $node = null): mixed;
  671. /**
  672. * Creates an HTML document from the DOM representation. This function is
  673. * usually called after building a new dom document from scratch as in the
  674. * example below.
  675. *
  676. * @param string $file - The path to the saved HTML document.
  677. *
  678. * @return mixed - Returns the number of bytes written or FALSE if an error
  679. * occurred.
  680. *
  681. */
  682. <<__Native>>
  683. public function saveHTMLFile(string $file): mixed;
  684. /**
  685. * Creates an XML document from the DOM representation. This function is
  686. * usually called after building a new dom document from scratch as in the
  687. * example below.
  688. *
  689. * @param DOMNode $node - Use this parameter to output only a specific node
  690. * without XML declaration rather than the entire document.
  691. * @param int $options - Additional Options. Currently only
  692. * LIBXML_NOEMPTYTAG is supported.
  693. *
  694. * @return mixed - Returns the XML, or FALSE if an error occurred.
  695. *
  696. */
  697. <<__Native>>
  698. public function saveXML(?DOMNode $node = null, int $options = 0): mixed;
  699. /**
  700. * Validates a document based on the given schema file.
  701. *
  702. * @param string $filename - The path to the schema.
  703. *
  704. * @return bool - Returns TRUE on success or FALSE on failure.
  705. *
  706. */
  707. <<__Native>>
  708. public function schemaValidate(string $filename): bool;
  709. /**
  710. * Validates a document based on a schema defined in the given string.
  711. *
  712. * @param string $source - A string containing the schema.
  713. *
  714. * @return bool - Returns TRUE on success or FALSE on failure.
  715. *
  716. */
  717. <<__Native>>
  718. public function schemaValidateSource(string $source): bool;
  719. /**
  720. * Validates the document based on its DTD. You can also use the
  721. * validateOnParse property of DOMDocument to make a DTD validation.
  722. *
  723. * @return bool - Returns TRUE on success or FALSE on failure. If the
  724. * document have no DTD attached, this method will return FALSE.
  725. *
  726. */
  727. <<__Native>>
  728. public function validate(): bool;
  729. /**
  730. * @param int $options - libxml parameters. Available since PHP 5.1.0 and
  731. * Libxml 2.6.7.
  732. *
  733. * @return mixed - Returns the number of XIncludes in the document, -1 if
  734. * some processing failed, or FALSE if there were no substitutions.
  735. *
  736. */
  737. <<__Native>>
  738. public function xinclude(int $options = 0): mixed;
  739. /**
  740. * @return array - var_dump() compat output helper.
  741. *
  742. */
  743. <<__Native>>
  744. public function __debuginfo(): array;
  745. }
  746. class DOMDocumentFragment extends DOMNode {
  747. <<__Native>>
  748. public function __construct(): void;
  749. /**
  750. * Appends raw XML data to a DOMDocumentFragment. This method is not part
  751. * of the DOM standard. It was created as a simpler approach for appending
  752. * an XML DocumentFragment in a DOMDocument. If you want to stick to the
  753. * standards, you will have to create a temporary DOMDocument with a dummy
  754. * root and then loop through the child nodes of the root of your XML data
  755. * to append them.
  756. *
  757. * @param string $data - XML to append.
  758. *
  759. * @return bool - Returns TRUE on success or FALSE on failure.
  760. *
  761. */
  762. <<__Native>>
  763. public function appendXML(string $data): bool;
  764. }
  765. /**
  766. * Each DOMDocument has a doctype attribute whose value is either NULL or a
  767. * DOMDocumentType object.
  768. *
  769. */
  770. class DOMDocumentType extends DOMNode {
  771. /**
  772. * @return array - var_dump() compat output helper.
  773. *
  774. */
  775. <<__Native>>
  776. public function __debuginfo(): array;
  777. }
  778. <<__NativeData("DOMElement")>>
  779. class DOMElement extends DOMNode {
  780. <<__Native>>
  781. public function __construct(string $name,
  782. ?string $value = null,
  783. ?string $namespaceuri = null): void;
  784. /**
  785. * Gets the value of the attribute with name name for the current node.
  786. *
  787. * @param string $name - The name of the attribute.
  788. *
  789. * @return string - The value of the attribute, or an empty string if no
  790. * attribute with the given name is found.
  791. *
  792. */
  793. <<__Native>>
  794. public function getAttribute(string $name): string;
  795. /**
  796. * Returns the attribute node with name name for the current element.
  797. *
  798. * @param string $name - The name of the attribute.
  799. *
  800. * @return mixed - The attribute node.
  801. *
  802. */
  803. <<__Native>>
  804. public function getAttributeNode(string $name): mixed;
  805. /**
  806. * Returns the attribute node in namespace namespaceURI with local name
  807. * localName for the current node.
  808. *
  809. * @param string $namespaceuri - The namespace URI.
  810. * @param string $localname - The local name.
  811. *
  812. * @return object - The attribute node.
  813. *
  814. */
  815. <<__Native>>
  816. public function getAttributeNodeNS(string $namespaceuri, string $localname): object;
  817. /**
  818. * Gets the value of the attribute in namespace namespaceURI with local name
  819. * localName for the current node.
  820. *
  821. * @param string $namespaceuri - The namespace URI.
  822. * @param string $localname - The local name.
  823. *
  824. * @return string - The value of the attribute, or an empty string if no
  825. * attribute with the given localName and namespaceURI is found.
  826. *
  827. */
  828. <<__Native>>
  829. public function getAttributeNS(string $namespaceuri, string $localname): string;
  830. /**
  831. * This function returns a new instance of the class DOMNodeList of all
  832. * descendant elements with a given tag name, in the order in which they are
  833. * encountered in a preorder traversal of this element tree.
  834. *
  835. * @param string $name - The tag name. Use * to return all elements within
  836. * the element tree.
  837. *
  838. * @return object - This function returns a new instance of the class
  839. * DOMNodeList of all matched elements.
  840. *
  841. */
  842. <<__Native>>
  843. public function getElementsByTagName(string $name): object;
  844. /**
  845. * This function fetch all the descendant elements with a given localName
  846. * and namespaceURI.
  847. *
  848. * @param string $namespaceuri - The namespace URI.
  849. * @param string $localname - The local name. Use * to return all elements
  850. * within the element tree.
  851. *
  852. * @return object - This function returns a new instance of the class
  853. * DOMNodeList of all matched elements in the order in which they are
  854. * encountered in a preorder traversal of this element tree.
  855. *
  856. */
  857. <<__Native>>
  858. public function getElementsByTagNameNS(string $namespaceuri,
  859. string $localname): object;
  860. /**
  861. * Indicates whether attribute named name exists as a member of the element.
  862. *
  863. * @param string $name - The attribute name.
  864. *
  865. * @return bool - Returns TRUE on success or FALSE on failure.
  866. *
  867. */
  868. <<__Native>>
  869. public function hasAttribute(string $name): bool;
  870. /**
  871. * Indicates whether attribute in namespace namespaceURI named localName
  872. * exists as a member of the element.
  873. *
  874. * @param string $namespaceuri - The namespace URI.
  875. * @param string $localname - The local name.
  876. *
  877. * @return bool - Returns TRUE on success or FALSE on failure.
  878. *
  879. */
  880. <<__Native>>
  881. public function hasAttributeNS(string $namespaceuri, string $localname): bool;
  882. /**
  883. * Removes attribute named name from the element.
  884. *
  885. * @param string $name - The name of the attribute.
  886. *
  887. * @return bool - Returns TRUE on success or FALSE on failure.
  888. *
  889. */
  890. <<__Native>>
  891. public function removeAttribute(string $name): bool;
  892. /**
  893. * Removes attribute oldnode from the element.
  894. *
  895. * @param DOMAttr $oldattr - The attribute node.
  896. *
  897. * @return mixed - Returns TRUE on success or FALSE on failure.
  898. *
  899. */
  900. <<__Native>>
  901. public function removeAttributeNode(DOMAttr $oldattr): mixed;
  902. /**
  903. * Removes attribute is namespace namespaceURI named localName from the
  904. * element.
  905. *
  906. * @param string $namespaceuri - The namespace URI.
  907. * @param string $localname - The local name.
  908. *
  909. * @return mixed - Returns TRUE on success or FALSE on failure.
  910. *
  911. */
  912. <<__Native>>
  913. public function removeAttributeNS(string $namespaceuri, string $localname): mixed;
  914. /**
  915. * Sets an attribute with name name to the given value. If the attribute
  916. * does not exist, it will be created.
  917. *
  918. * @param string $name - The name of the attribute.
  919. * @param string $value - The value of the attribute.
  920. *
  921. * @return mixed - The new DOMAttr or FALSE if an error occurred.
  922. *
  923. */
  924. <<__Native>>
  925. public function setAttribute(string $name, string $value): mixed;
  926. /**
  927. * Adds new attribute node attr to element.
  928. *
  929. * @param DOMAttr $newattr - The attribute node.
  930. *
  931. * @return mixed - Returns old node if the attribute has been replaced or
  932. * NULL.
  933. *
  934. */
  935. <<__Native>>
  936. public function setAttributeNode(DOMAttr $newattr): mixed;
  937. /**
  938. * Adds new attribute node attr to element.
  939. *
  940. * @param DOMAttr $newattr - The attribute node.
  941. *
  942. * @return mixed - Returns the old node if the attribute has been replaced.
  943. *
  944. */
  945. <<__Native>>
  946. public function setAttributeNodeNS(DOMAttr $newattr): mixed;
  947. /**
  948. * Sets an attribute with namespace namespaceURI and name name to the given
  949. * value. If the attribute does not exist, it will be created.
  950. *
  951. * @param string $namespaceuri - The namespace URI.
  952. * @param string $name - The qualified name of the attribute, as
  953. * prefix:tagname.
  954. * @param string $value - The value of the attribute.
  955. *
  956. * @return mixed - No value is returned.
  957. *
  958. */
  959. <<__Native>>
  960. public function setAttributeNS(string $namespaceuri,
  961. string $name,
  962. string $value): mixed;
  963. /**
  964. * Declares the attribute name to be of type ID.
  965. *
  966. * @param string $name - The name of the attribute.
  967. * @param bool $isid - Set it to TRUE if you want name to be of type ID,
  968. * FALSE otherwise.
  969. *
  970. * @return mixed - No value is returned.
  971. *
  972. */
  973. <<__Native>>
  974. public function setIDAttribute(string $name, bool $isid): mixed;
  975. /**
  976. * Declares the attribute specified by attr to be of type ID.
  977. *
  978. * @param DOMAttr $idattr - The attribute node.
  979. * @param bool $isid - Set it to TRUE if you want name to be of type ID,
  980. * FALSE otherwise.
  981. *
  982. * @return mixed - No value is returned.
  983. *
  984. */
  985. <<__Native>>
  986. public function setIDAttributeNode(DOMAttr $idattr, bool $isid): mixed;
  987. /**
  988. * Declares the attribute specified by localName and namespaceURI to be of
  989. * type ID.
  990. *
  991. * @param string $namespaceuri - The namespace URI of the attribute.
  992. * @param string $localname - The local name of the attribute, as
  993. * prefix:tagname.
  994. * @param bool $isid - Set it to TRUE if you want name to be of type ID,
  995. * FALSE otherwise.
  996. *
  997. * @return mixed - No value is returned.
  998. *
  999. */
  1000. <<__Native>>
  1001. public function setIDAttributeNS(string $namespaceuri,
  1002. string $localname,
  1003. bool $isid): mixed;
  1004. /**
  1005. * @return array - var_dump() compat output helper.
  1006. *
  1007. */
  1008. <<__Native>>
  1009. public function __debuginfo(): array;
  1010. }
  1011. /**
  1012. * This interface represents a known entity, either parsed or unparsed, in an
  1013. * XML document.
  1014. *
  1015. */
  1016. class DOMEntity extends DOMNode {
  1017. /**
  1018. * @return array - var_dump() compat output helper.
  1019. *
  1020. */
  1021. <<__Native>>
  1022. public function __debuginfo(): array;
  1023. }
  1024. class DOMEntityReference extends DOMNode {
  1025. <<__Native>>
  1026. public function __construct(string $name): void;
  1027. }
  1028. class DOMNotation extends DOMNode {
  1029. /**
  1030. * @return array - var_dump() compat output helper.
  1031. *
  1032. */
  1033. <<__Native>>
  1034. public function __debuginfo(): array;
  1035. }
  1036. class DOMProcessingInstruction extends DOMNode {
  1037. <<__Native>>
  1038. public function __construct(string $name, ?string $value = null): void;
  1039. /**
  1040. * @return array - var_dump() compat output helper.
  1041. *
  1042. */
  1043. <<__Native>>
  1044. public function __debuginfo(): array;
  1045. }
  1046. class DOMNameSpaceNode extends DOMNode {
  1047. }
  1048. <<__NativeData("DOMNodeIterator")>>
  1049. class DOMNodeIterator implements Iterator {
  1050. public function __construct(): void {
  1051. }
  1052. <<__Native>>
  1053. public function current(): mixed;
  1054. <<__Native>>
  1055. public function key(): mixed;
  1056. <<__Native>>
  1057. public function next(): mixed;
  1058. <<__Native>>
  1059. public function rewind(): mixed;
  1060. <<__Native>>
  1061. public function valid(): mixed;
  1062. }
  1063. <<__NativeData("DOMIterable")>>
  1064. class DOMNamedNodeMap implements IteratorAggregate {
  1065. public function __construct(): void {
  1066. }
  1067. /**
  1068. * Retrieves a node specified by its nodeName.
  1069. *
  1070. * @param string $name - The nodeName of the node to retrieve.
  1071. *
  1072. * @return mixed - A node (of any type) with the specified nodeName, or NULL
  1073. * if no node is found.
  1074. *
  1075. */
  1076. <<__Native>>
  1077. public function getNamedItem(string $name): mixed;
  1078. /**
  1079. * Retrieves a node specified by localName and namespaceURI.
  1080. *
  1081. * @param string $namespaceuri - The namespace URI of the node to retrieve.
  1082. * @param string $localname - The local name of the node to retrieve.
  1083. *
  1084. * @return mixed - A node (of any type) with the specified local name and
  1085. * namespace URI, or NULL if no node is found.
  1086. *
  1087. */
  1088. <<__Native>>
  1089. public function getNamedItemNS(string $namespaceuri, string $localname): mixed;
  1090. /**
  1091. * Retrieves a node specified by index within the DOMNamedNodeMap object.
  1092. *
  1093. * @param int $index - Index into this map.
  1094. *
  1095. * @return mixed - The node at the indexth position in the map, or NULL if
  1096. * that is not a valid index (greater than or equal to the number of nodes
  1097. * in this map).
  1098. *
  1099. */
  1100. <<__Native>>
  1101. public function item(int $index): mixed;
  1102. <<__Native>>
  1103. public function getIterator(): mixed;
  1104. }
  1105. <<__NativeData("DOMIterable")>>
  1106. class DOMNodeList implements IteratorAggregate {
  1107. public function __construct(): void {
  1108. }
  1109. /**
  1110. * Retrieves a node specified by index within the DOMNodeList object. Tip
  1111. * If you need to know the number of nodes in the collection, use the length
  1112. * property of the DOMNodeList object.
  1113. *
  1114. * @param int $index - Index of the node into the collection.
  1115. *
  1116. * @return mixed - The node at the indexth position in the DOMNodeList, or
  1117. * NULL if that is not a valid index.
  1118. *
  1119. */
  1120. <<__Native>>
  1121. public function item(int $index): mixed;
  1122. <<__Native>>
  1123. public function getIterator(): mixed;
  1124. /**
  1125. * @return array - var_dump() compat output helper.
  1126. *
  1127. */
  1128. <<__Native>>
  1129. public function __debuginfo(): array;
  1130. }
  1131. /**
  1132. * The DOMImplementation interface provides a number of methods for performing
  1133. * operations that are independent of any particular instance of the document
  1134. * object model.
  1135. *
  1136. */
  1137. class DOMImplementation {
  1138. public function __construct(): void {
  1139. }
  1140. /**
  1141. * Creates a DOMDocument object of the specified type with its document
  1142. * element.
  1143. *
  1144. * @param string $namespaceuri - The namespace URI of the document element
  1145. * to create.
  1146. * @param string $qualifiedname - The qualified name of the document element
  1147. * to create.
  1148. * @param DOMDocumentType $doctypeobj - The type of document to create or
  1149. * null.
  1150. *
  1151. * @return mixed - A new DOMDocument object. If namespaceURI, qualifiedName,
  1152. * and doctype are null, the returned DOMDocument is empty with no document
  1153. * element
  1154. *
  1155. */
  1156. <<__Native>>
  1157. public function createDocument(?string $namespaceuri = null,
  1158. ?string $qualifiedname = null,
  1159. ?DOMDocumentType $doctypeobj = null): mixed;
  1160. /**
  1161. * Creates an empty DOMDocumentType object. Entity declarations and
  1162. * notations are not made available. Entity reference expansions and default
  1163. * attribute additions do not occur.
  1164. *
  1165. * @param string $qualifiedname - The qualified name of the document type to
  1166. * create.
  1167. * @param string $publicid - The external subset public identifier.
  1168. * @param string $systemid - The external subset system identifier.
  1169. *
  1170. * @return mixed - A new DOMDocumentType node with its ownerDocument set to
  1171. * NULL.
  1172. *
  1173. */
  1174. <<__Native>>
  1175. public function createDocumentType(?string $qualifiedname = null,
  1176. ?string $publicid = null,
  1177. ?string $systemid = null): mixed;
  1178. /**
  1179. * @param string $feature - The feature to test.
  1180. * @param string $version - The version number of the feature to test. In
  1181. * level 2, this can be either 2.0 or 1.0.
  1182. *
  1183. * @return bool - Returns TRUE on success or FALSE on failure.
  1184. *
  1185. */
  1186. <<__Native>>
  1187. public function hasFeature(string $feature, string $version): bool;
  1188. }
  1189. /**
  1190. * Supports XPath 1.0
  1191. *
  1192. */
  1193. <<__NativeData("DOMXPath")>>
  1194. class DOMXPath {
  1195. <<__Native>>
  1196. public function __construct(mixed $doc): void;
  1197. /**
  1198. * Executes the given XPath expression and returns a typed result if
  1199. * possible.
  1200. *
  1201. * @param string $expr - The XPath expression to execute.
  1202. * @param DOMNode $context - The optional contextnode can be specified for
  1203. * doing relative XPath queries. By default, the queries are relative to the
  1204. * root element.
  1205. * @param bool $registgerNodeNS - disable automatic registration of the
  1206. * context node.
  1207. *
  1208. * @return mixed - Returns a typed result if possible or a DOMNodeList
  1209. * containing all nodes matching the given XPath expression.
  1210. *
  1211. */
  1212. <<__Native>>
  1213. public function evaluate(string $expr,
  1214. ?DOMNode $context = null,
  1215. bool $registerNodeNS = true): mixed;
  1216. /**
  1217. * Executes the given XPath expression.
  1218. *
  1219. * @param string $expr - The XPath expression to execute.
  1220. * @param DOMNode $context - The optional contextnode can be specified for
  1221. * doing relative XPath queries. By default, the queries are relative to the
  1222. * root element.
  1223. * @param bool $registgerNodeNS - disable automatic registration of the
  1224. * context node.
  1225. *
  1226. * @return mixed - Returns a DOMNodeList containing all nodes matching the
  1227. * given XPath expression. Any expression which do not return nodes will
  1228. * return an empty DOMNodeList.
  1229. *
  1230. */
  1231. <<__Native>>
  1232. public function query(string $expr,
  1233. ?DOMNode $context = null,
  1234. bool $registerNodeNS = true): mixed;
  1235. /**
  1236. * Registers the namespaceURI and prefix with the DOMXPath object.
  1237. *
  1238. * @param string $prefix - The prefix.
  1239. * @param string $uri - The URI of the namespace.
  1240. *
  1241. * @return bool - Returns TRUE on success or FALSE on failure.
  1242. *
  1243. */
  1244. <<__Native>>
  1245. public function registerNamespace(string $prefix, string $uri): bool;
  1246. /**
  1247. * This method enables the ability to use PHP functions within XPath
  1248. * expressions.
  1249. *
  1250. * @param mixed $funcs - Use this parameter to only allow certain functions
  1251. * to be called from XPath. This parameter can be either a string (a
  1252. * function name) or an array of function names.
  1253. *
  1254. * @return mixed - No value is returned.
  1255. *
  1256. */
  1257. <<__Native>>
  1258. public function registerPHPFunctions(mixed $funcs = null): mixed;
  1259. <<__Native>>
  1260. public function __debuginfo(): array;
  1261. }
  1262. function dom_document_create_element(DOMDocument $obj,
  1263. string $name,
  1264. ?string $value = null): mixed {
  1265. return $obj->createElement($name, $value);
  1266. }
  1267. function dom_document_create_document_fragment(DOMDocument $obj): mixed {
  1268. return $obj->createDocumentFragment();
  1269. }
  1270. function dom_document_create_text_node(DOMDocument $obj, string $data): mixed {
  1271. return $obj->createTextNode($data);
  1272. }
  1273. function dom_document_create_comment(DOMDocument $obj, string $data): mixed {
  1274. return $obj->createComment($data);
  1275. }
  1276. function dom_document_create_cdatasection(DOMDocument $obj,
  1277. string $data): mixed {
  1278. return $obj->createCDATASection($data);
  1279. }
  1280. function dom_document_create_processing_instruction(DOMDocument $obj,
  1281. string $target, ?string $data = null): mixed {
  1282. return $obj->createProcessingInstruction($target, $data);
  1283. }
  1284. function dom_document_create_attribute(DOMDocument $obj, string $name): mixed {
  1285. return $obj->createAttribute($name);
  1286. }
  1287. function dom_document_create_entity_reference(DOMDocument $obj,
  1288. string $name): mixed {
  1289. return $obj->createEntityReference($name);
  1290. }
  1291. function dom_document_get_elements_by_tag_name(DOMDocument $obj,
  1292. string $name): mixed {
  1293. return $obj->getElementsByTagName($name);
  1294. }
  1295. function dom_document_import_node(DOMDocument $obj,
  1296. DOMNode $importednode,
  1297. bool $deep = false): mixed {
  1298. return $obj->importNode($importednode, $deep);
  1299. }
  1300. function dom_document_create_element_ns(DOMDocument $obj,
  1301. string $namespaceuri,
  1302. string $qualifiedname,
  1303. ?string $value = null): mixed {
  1304. return $obj->createElementNS($namespaceuri, $qualifiedname, $value);
  1305. }
  1306. function dom_document_create_attribute_ns(DOMDocument $obj,
  1307. string $namespaceuri,
  1308. string $qualifiedname): mixed {
  1309. return $obj->createAttributeNS($namespaceuri, $qualifiedname);
  1310. }
  1311. function dom_document_get_elements_by_tag_name_ns(DOMDocument $obj,
  1312. string $namespaceuri,
  1313. string $localname): mixed {
  1314. return $obj->getElementsByTagNameNS($namespaceuri, $localname);
  1315. }
  1316. function dom_document_get_element_by_id(DOMDocument $obj,
  1317. string $elementid): mixed {
  1318. return $obj->getElementById($elementid);
  1319. }
  1320. function dom_document_normalize_document(DOMDocument $obj): void {
  1321. $obj->normalizeDocument();
  1322. }
  1323. /**
  1324. * Creates an XML document from the DOM representation. This function is
  1325. * usually called after building a new dom document from scratch as in the
  1326. * example below.
  1327. *
  1328. * @param DOMDocument $obj
  1329. * @param string $file - The path to the saved XML document.
  1330. * @param int $options - Additional Options. Currently only
  1331. * LIBXML_NOEMPTYTAG is supported.
  1332. *
  1333. * @return mixed - Returns the number of bytes written or FALSE if an error
  1334. * occurred.
  1335. *
  1336. */
  1337. function dom_document_save(DOMDocument $obj,
  1338. string $file,
  1339. int $options = 0): mixed {
  1340. return $obj->save($file, $options);
  1341. }
  1342. /**
  1343. * Creates an XML document from the DOM representation. This function is
  1344. * usually called after building a new dom document from scratch as in the
  1345. * example below.
  1346. *
  1347. * @param DOMDocument $obj
  1348. * @param DOMNode $node - Use this parameter to output only a specific node
  1349. * without XML declaration rather than the entire document.
  1350. * @param int $options - Additional Options. Currently only
  1351. * LIBXML_NOEMPTYTAG is supported.
  1352. *
  1353. * @return mixed - Returns the XML, or FALSE if an error occurred.
  1354. *
  1355. */
  1356. function dom_document_savexml(DOMDocument $obj,
  1357. ?DOMNode $node = null,
  1358. int $options = 0): mixed {
  1359. return $obj->saveXML($node, $options);
  1360. }
  1361. /**
  1362. * Validates the document based on its DTD. You can also use the
  1363. * validateOnParse property of DOMDocument to make a DTD validation.
  1364. *
  1365. * @return bool - Returns TRUE on success or FALSE on failure. If the
  1366. * document have no DTD attached, this method will return FALSE.
  1367. *
  1368. */
  1369. function dom_document_validate(DOMDocument $obj): bool {
  1370. return $obj->validate();
  1371. }
  1372. /**
  1373. * @param DOMDocument $obj - libxml parameters. Available since PHP 5.1.0 and
  1374. * Libxml 2.6.7.
  1375. *
  1376. * @return mixed - Returns the number of XIncludes in the document, -1 if some
  1377. * processing failed, or FALSE if there were no substitutions.
  1378. *
  1379. */
  1380. function dom_document_xinclude(DOMDocument $obj,
  1381. int $options = 0): mixed {
  1382. return $obj->xinclude($options);
  1383. }
  1384. /**
  1385. * Creates an HTML document from the DOM representation. This function is
  1386. * usually called after building a new dom document from scratch as in the
  1387. * example below.
  1388. *
  1389. * @param DOMDocument $obj
  1390. * @param DOMNode $node - Optional parameter to output a subset of the
  1391. * document.
  1392. *
  1393. * @return mixed - Returns the HTML, or FALSE if an error occurred.
  1394. *
  1395. */
  1396. function dom_document_save_html(DOMDocument $obj,
  1397. ?DOMNode $node = null): mixed {
  1398. return $obj->saveHTML($node);
  1399. }
  1400. function dom_document_save_html_file(DOMDocument $obj,
  1401. string $file): mixed {
  1402. return $obj->saveHTMLFile($file);
  1403. }
  1404. function dom_document_schema_validate_file(DOMDocument $obj,
  1405. string $filename): bool {
  1406. return $obj->schemaValidate($filename);
  1407. }
  1408. function dom_document_schema_validate_xml(DOMDocument $obj,
  1409. string $source): bool {
  1410. return $obj->schemaValidate($source);
  1411. }
  1412. function dom_document_relaxng_validate_file(DOMDocument $obj,
  1413. string $filename): bool {
  1414. return $obj->relaxNGValidate($filename);
  1415. }
  1416. function dom_document_relaxng_validate_xml(DOMDocument $obj,
  1417. string $source): bool {
  1418. return $obj->relaxNGValidateSource($source);
  1419. }
  1420. function dom_node_insert_before(DOMNode $obj,
  1421. DOMNode $newnode,
  1422. ?DOMNode $refnode = null): mixed {
  1423. return $obj->insertBefore($newnode, $refnode);
  1424. }
  1425. function dom_node_replace_child(DOMNode $obj,
  1426. DOMNode $newchildobj,
  1427. DOMNode $oldchildobj): mixed {
  1428. return $obj->replaceChild($newchildobj, $oldchildobj);
  1429. }
  1430. function dom_node_remove_child(DOMNode $obj,
  1431. DOMNode $node): mixed {
  1432. return $obj->removeChild($node);
  1433. }
  1434. function dom_node_append_child(DOMNode $obj,
  1435. DOMNode $newnode): mixed {
  1436. return $obj->appendChild($newnode);
  1437. }
  1438. function dom_node_has_child_nodes(DOMNode $obj): bool {
  1439. return $obj->hasChildNodes();
  1440. }
  1441. function dom_node_clone_node(DOMNode $obj,
  1442. bool $deep = false): mixed {
  1443. return $obj->cloneNode($deep);
  1444. }
  1445. function dom_node_normalize(DOMNode $obj): void {
  1446. $obj->normalize();
  1447. }
  1448. function dom_node_is_supported(DOMNode $obj,
  1449. string $feature,
  1450. string $version): bool {
  1451. return $obj->isSupported($feature, $version);
  1452. }
  1453. function dom_node_has_attributes(DOMNode $obj): bool {
  1454. return $obj->hasAttributes();
  1455. }
  1456. function dom_node_is_same_node(DOMNode $obj,
  1457. DOMNode $node): bool {
  1458. return $obj->isSameNode($node);
  1459. }
  1460. function dom_node_lookup_prefix(DOMNode $obj,
  1461. string $prefix): mixed {
  1462. return $obj->lookupPrefix($prefix);
  1463. }
  1464. function dom_node_is_default_namespace(DOMNode $obj,
  1465. string $namespaceuri): bool {
  1466. return $obj->isDefaultNamespace($namespaceuri);
  1467. }
  1468. function dom_node_lookup_namespace_uri(DOMNode $obj,
  1469. string $namespaceuri): mixed {
  1470. return $obj->lookupNamespaceUri($namespaceuri);
  1471. }
  1472. /*…

Large files files are truncated, but you can click here to view the full file