/hphp/runtime/ext/xmlwriter/ext_xmlwriter.php

https://gitlab.com/Blueprint-Marketing/hhvm · PHP · 849 lines · 256 code · 85 blank · 508 comment · 0 complexity · 53633c97cc17882e503520f942c2f948 MD5 · raw file

  1. <?hh
  2. // generated by idl-to-hni.php
  3. /* Represents a writer that provides a non-cached, forward-only means of
  4. * generating streams or files containing XML data.
  5. */
  6. <<__NativeData("XMLWriterData")>>
  7. class XMLWriter {
  8. function __construct() {}
  9. /* Create new xmlwriter using memory for string output.
  10. * @return bool - Returns TRUE on success or FALSE on failure.
  11. */
  12. <<__Native>>
  13. function openMemory(): bool;
  14. /* Creates a new XMLWriter using uri for the output.
  15. * @param string $uri - The URI of the resource for the output.
  16. * @return mixed - Returns TRUE on success or FALSE on
  17. */
  18. <<__Native>>
  19. function openURI(string $uri): bool;
  20. /* Sets the string which will be used to indent each element/attribute of the
  21. * resulting xml.
  22. * @param string $indentstring - The indentation string.
  23. * @return bool - Returns TRUE on success or FALSE on failure.
  24. */
  25. <<__Native>>
  26. function setIndentString(string $indentstring): bool;
  27. /* Toggles indentation on or off.
  28. * @param bool $indent - Whether indentation is enabled.
  29. * @return bool - Returns TRUE on success or FALSE on failure.
  30. */
  31. <<__Native>>
  32. function setIndent(bool $indent): bool;
  33. /* Starts a document.
  34. * @param string $version - The version number of the document as part of the
  35. * XML declaration. Defaults to 1.0.
  36. * @param string $encoding - The encoding of the document as part of the XML
  37. * declaration. NULL by default.
  38. * @param string $standalone - yes or no.
  39. * @return bool - Returns TRUE on success or FALSE on failure.
  40. */
  41. <<__Native>>
  42. function startDocument(?string $version = "1.0",
  43. ?string $encoding = "",
  44. ?string $standalone = ""): bool;
  45. /* Starts an element.
  46. * @param string $name - The element name.
  47. * @return bool - Returns TRUE on success or FALSE on failure.
  48. */
  49. <<__Native>>
  50. function startElement(string $name): bool;
  51. /* Starts a namespaced element.
  52. * @param mixed $prefix - The namespace prefix.
  53. * @param string $name - The element name.
  54. * @param string $uri - The namespace URI.
  55. * @return bool - Returns TRUE on success or FALSE on failure.
  56. */
  57. <<__Native>>
  58. function startElementNS(mixed $prefix,
  59. string $name,
  60. mixed $uri): bool;
  61. /* Writes a full namespaced element tag.
  62. * @param string $prefix - The namespace prefix.
  63. * @param string $name - The element name.
  64. * @param string $uri - The namespace URI.
  65. * @param string $content - The element contents.
  66. * @return bool - Returns TRUE on success or FALSE on failure.
  67. */
  68. <<__Native>>
  69. function writeElementNS(?string $prefix,
  70. string $name,
  71. ?string $uri,
  72. ?string $content = null): bool;
  73. /* Writes a full element tag.
  74. * @param string $name - The element name.
  75. * @param string $content - The element contents.
  76. * @return bool - Returns TRUE on success or FALSE on failure.
  77. */
  78. <<__Native>>
  79. function writeElement(string $name,
  80. ?string $content = null): bool;
  81. /* Ends the current element.
  82. * @return bool - Returns TRUE on success or FALSE on failure.
  83. */
  84. <<__Native>>
  85. function endElement(): bool;
  86. /* End the current xml element. Writes an end tag even if the element is
  87. * empty.
  88. * @return bool - Returns TRUE on success or FALSE on failure.
  89. */
  90. <<__Native>>
  91. function fullEndElement(): bool;
  92. /* Starts a namespaced attribute.
  93. * @param string $prefix - The namespace prefix.
  94. * @param string $name - The attribute name.
  95. * @param string $uri - The namespace URI.
  96. * @return bool - Returns TRUE on success or FALSE on failure.
  97. */
  98. <<__Native>>
  99. function startAttributeNS(string $prefix,
  100. string $name,
  101. string $uri): bool;
  102. /* Starts an attribute.
  103. * @param string $name - The attribute name.
  104. * @return bool - Returns TRUE on success or FALSE on failure.
  105. */
  106. <<__Native>>
  107. function startAttribute(string $name): bool;
  108. /* Writes a full namespaced attribute.
  109. * @param string $prefix - The namespace prefix.
  110. * @param string $name - The attribute name.
  111. * @param string $uri - The namespace URI.
  112. * @param string $content - The attribute value.
  113. * @return bool - Returns TRUE on success or FALSE on failure.
  114. */
  115. <<__Native>>
  116. function writeAttributeNS(string $prefix,
  117. string $name,
  118. string $uri,
  119. string $content): bool;
  120. /* Writes a full attribute.
  121. * @param string $name - The name of the attribute.
  122. * @param string $value - The value of the attribute.
  123. * @return bool - Returns TRUE on success or FALSE on failure.
  124. */
  125. <<__Native>>
  126. function writeAttribute(string $name,
  127. string $value): bool;
  128. /* Ends the current attribute.
  129. * @return bool - Returns TRUE on success or FALSE on failure.
  130. */
  131. <<__Native>>
  132. function endAttribute(): bool;
  133. /* Starts a CDATA.
  134. * @return bool - Returns TRUE on success or FALSE on failure.
  135. */
  136. <<__Native>>
  137. function startCData(): bool;
  138. /* Writes a full CDATA.
  139. * @param string $content - The contents of the CDATA.
  140. * @return bool - Returns TRUE on success or FALSE on failure.
  141. */
  142. <<__Native>>
  143. function writeCData(string $content): bool;
  144. /* Ends the current CDATA section.
  145. * @return bool - Returns TRUE on success or FALSE on failure.
  146. */
  147. <<__Native>>
  148. function endCData(): bool;
  149. /* Starts a comment.
  150. * @return bool - Returns TRUE on success or FALSE on failure.
  151. */
  152. <<__Native>>
  153. function startComment(): bool;
  154. /* Writes a full comment.
  155. * @param string $content - The contents of the comment.
  156. * @return bool - Returns TRUE on success or FALSE on failure.
  157. */
  158. <<__Native>>
  159. function writeComment(string $content): bool;
  160. /* Ends the current comment.
  161. * @return bool - Returns TRUE on success or FALSE on failure.
  162. */
  163. <<__Native>>
  164. function endComment(): bool;
  165. /* Ends the current document.
  166. * @return bool - Returns TRUE on success or FALSE on failure.
  167. */
  168. <<__Native>>
  169. function endDocument(): bool;
  170. /* Starts a processing instruction tag.
  171. * @param string $target - The target of the processing instruction.
  172. * @return bool - Returns TRUE on success or FALSE on failure.
  173. */
  174. <<__Native>>
  175. function startPI(string $target): bool;
  176. /* Writes a processing instruction.
  177. * @param string $target - The target of the processing instruction.
  178. * @param string $content - The content of the processing instruction.
  179. * @return bool - Returns TRUE on success or FALSE on failure.
  180. */
  181. <<__Native>>
  182. function writePI(string $target,
  183. string $content): bool;
  184. /* Ends the current processing instruction.
  185. * @return bool - Returns TRUE on success or FALSE on failure.
  186. */
  187. <<__Native>>
  188. function endPI(): bool;
  189. /* Writes a text.
  190. * @param string $content - The contents of the text.
  191. * @return bool - Returns TRUE on success or FALSE on failure.
  192. */
  193. <<__Native>>
  194. function text(string $content): bool;
  195. /* Writes a raw xml text.
  196. * @param string $content - The text string to write.
  197. * @return bool - Returns TRUE on success or FALSE on failure.
  198. */
  199. <<__Native>>
  200. function writeRaw(string $content): bool;
  201. /* Starts a DTD.
  202. * @param string $qualifiedname - The qualified name of the document type to
  203. * create.
  204. * @param string $publicid - The external subset public identifier.
  205. * @param string $systemid - The external subset system identifier.
  206. * @return bool - Returns TRUE on success or FALSE on failure.
  207. */
  208. <<__Native>>
  209. function startDTD(string $qualifiedname,
  210. ?string $publicid = "",
  211. ?string $systemid = ""): bool;
  212. /* Writes a full DTD.
  213. * @param string $name - The DTD name.
  214. * @param string $publicid - The external subset public identifier.
  215. * @param string $systemid - The external subset system identifier.
  216. * @param string $subset - The content of the DTD.
  217. * @return bool - Returns TRUE on success or FALSE on failure.
  218. */
  219. <<__Native>>
  220. function writeDTD(string $name,
  221. ?string $publicid = "",
  222. ?string $systemid = "",
  223. ?string $subset = ""): bool;
  224. /* Starts a DTD element.
  225. * @param string $qualifiedname - The qualified name of the document type to
  226. * create.
  227. * @return bool - Returns TRUE on success or FALSE on failure.
  228. */
  229. <<__Native>>
  230. function startDTDElement(string $qualifiedname): bool;
  231. /* Writes a full DTD element.
  232. * @param string $name - The name of the DTD element.
  233. * @param string $content - The content of the element.
  234. * @return bool - Returns TRUE on success or FALSE on failure.
  235. */
  236. <<__Native>>
  237. function writeDTDElement(string $name,
  238. string $content): bool;
  239. /* Ends the current DTD element.
  240. * @return bool - Returns TRUE on success or FALSE on failure.
  241. */
  242. <<__Native>>
  243. function endDTDElement(): bool;
  244. /* Starts a DTD attribute list.
  245. * @param string $name - The attribute list name.
  246. * @return bool - Returns TRUE on success or FALSE on failure.
  247. */
  248. <<__Native>>
  249. function startDTDAttlist(string $name): bool;
  250. /* Writes a DTD attribute list.
  251. * @param string $name - The name of the DTD attribute list.
  252. * @param string $content - The content of the DTD attribute list.
  253. * @return bool - Returns TRUE on success or FALSE on failure.
  254. */
  255. <<__Native>>
  256. function writeDTDAttlist(string $name,
  257. string $content): bool;
  258. /* Ends the current DTD attribute list.
  259. * @return bool - Returns TRUE on success or FALSE on failure.
  260. */
  261. <<__Native>>
  262. function endDTDAttlist(): bool;
  263. /* Starts a DTD entity.
  264. * @param string $name - The name of the entity.
  265. * @param bool $isparam
  266. * @return bool - Returns TRUE on success or FALSE on failure.
  267. */
  268. <<__Native>>
  269. function startDTDEntity(string $name,
  270. bool $isparam): bool;
  271. /* Writes a full DTD entity.
  272. * @param string $name - The name of the entity.
  273. * @param string $content - The content of the entity.
  274. * @param bool $pe
  275. * @param string $publicid
  276. * @param string $systemid
  277. * @param string $ndataid
  278. * @return bool - Returns TRUE on success or FALSE on failure.
  279. */
  280. <<__Native>>
  281. function writeDTDEntity(string $name,
  282. string $content,
  283. bool $pe = false,
  284. string $publicid = "",
  285. string $systemid = "",
  286. string $ndataid = ""): bool;
  287. /* Ends the current DTD entity.
  288. * @return bool - Returns TRUE on success or FALSE on failure.
  289. */
  290. <<__Native>>
  291. function endDTDEntity(): bool;
  292. /* Ends the DTD of the document.
  293. * @return bool - Returns TRUE on success or FALSE on failure.
  294. */
  295. <<__Native>>
  296. function endDTD(): bool;
  297. /* Flushes the current buffer.
  298. * @param bool $empty - Whether to empty the buffer or no. Default is TRUE.
  299. * @return mixed - If you opened the writer in memory, this function returns
  300. * the generated XML buffer, Else, if using URI, this function will write the
  301. * buffer and return the number of written bytes.
  302. */
  303. <<__Native>>
  304. function flush(?bool $empty = true): mixed;
  305. /* Returns the current buffer.
  306. * @param bool $flush - Whether to flush the output buffer or no. Default is
  307. * TRUE.
  308. * @return string - Returns the current buffer as a string.
  309. */
  310. <<__Native>>
  311. function outputMemory(?bool $flush = true): string;
  312. }
  313. /* Creates a new XMLWriter using memory for string output.
  314. * @return mixed - Returns a new xmlwriter resource for later use with the
  315. * xmlwriter functions on success, FALSE on error.
  316. */
  317. <<__Native>>
  318. function xmlwriter_open_memory(): mixed;
  319. /* Creates a new XMLWriter using uri for the output.
  320. * @param string $uri - The URI of the resource for the output.
  321. * @return mixed - Returns a new xmlwriter resource for later use with the
  322. * xmlwriter functions on success, FALSE on error.
  323. */
  324. <<__Native>>
  325. function xmlwriter_open_uri(string $uri): mixed;
  326. /* Sets the string which will be used to indent each element/attribute of the
  327. * resulting xml.
  328. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  329. * This resource comes from a call to xmlwriter_open_uri() or
  330. * xmlwriter_open_memory().
  331. * @param string $indentString - The indentation string.
  332. * @return bool - Returns TRUE on success or FALSE on failure.
  333. */
  334. <<__Native>>
  335. function xmlwriter_set_indent_string(resource $xmlwriter,
  336. mixed $indentString): mixed;
  337. /* Toggles indentation on or off.
  338. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  339. * This resource comes from a call to xmlwriter_open_uri() or
  340. * xmlwriter_open_memory().
  341. * @param bool $indent - Whether indentation is enabled.
  342. * @return bool - Returns TRUE on success or FALSE on failure.
  343. */
  344. <<__Native>>
  345. function xmlwriter_set_indent(resource $xmlwriter,
  346. bool $indent): bool;
  347. /* Starts a document.
  348. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  349. * This resource comes from a call to xmlwriter_open_uri() or
  350. * xmlwriter_open_memory().
  351. * @param string $version - The version number of the document as part of the
  352. * XML declaration. Defaults to 1.0.
  353. * @param string $encoding - The encoding of the document as part of the XML
  354. * declaration. NULL by default.
  355. * @param string $standalone - yes or no.
  356. * @return bool - Returns TRUE on success or FALSE on failure.
  357. */
  358. <<__Native>>
  359. function xmlwriter_start_document(resource $xmlwriter,
  360. ?string $version = "1.0",
  361. ?string $encoding = "",
  362. ?string $standalone = ""): bool;
  363. /* Starts an element.
  364. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  365. * This resource comes from a call to xmlwriter_open_uri() or
  366. * xmlwriter_open_memory().
  367. * @param string $name - The element name.
  368. * @return bool - Returns TRUE on success or FALSE on failure.
  369. */
  370. <<__Native>>
  371. function xmlwriter_start_element(resource $xmlwriter,
  372. string $name): bool;
  373. /* Starts a namespaced element.
  374. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  375. * This resource comes from a call to xmlwriter_open_uri() or
  376. * xmlwriter_open_memory().
  377. * @param mixed $prefix - The namespace prefix.
  378. * @param string $name - The element name.
  379. * @param string $uri - The namespace URI.
  380. * @return bool - Returns TRUE on success or FALSE on failure.
  381. */
  382. <<__Native>>
  383. function xmlwriter_start_element_ns(resource $xmlwriter,
  384. mixed $prefix,
  385. string $name,
  386. mixed $uri): bool;
  387. /* Writes a full namespaced element tag.
  388. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  389. * This resource comes from a call to xmlwriter_open_uri() or
  390. * xmlwriter_open_memory().
  391. * @param string $prefix - The namespace prefix.
  392. * @param string $name - The element name.
  393. * @param string $uri - The namespace URI.
  394. * @param string $content - The element contents.
  395. * @return bool - Returns TRUE on success or FALSE on failure.
  396. */
  397. <<__Native>>
  398. function xmlwriter_write_element_ns(resource $xmlwriter,
  399. ?string $prefix,
  400. string $name,
  401. ?string $uri,
  402. ?string $content = null): bool;
  403. /* Writes a full element tag.
  404. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  405. * This resource comes from a call to xmlwriter_open_uri() or
  406. * xmlwriter_open_memory().
  407. * @param string $name - The element name.
  408. * @param string $content - The element contents.
  409. * @return bool - Returns TRUE on success or FALSE on failure.
  410. */
  411. <<__Native>>
  412. function xmlwriter_write_element(resource $xmlwriter,
  413. string $name,
  414. ?string $content = null): bool;
  415. /* Ends the current element.
  416. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  417. * This resource comes from a call to xmlwriter_open_uri() or
  418. * xmlwriter_open_memory().
  419. * @return bool - Returns TRUE on success or FALSE on failure.
  420. */
  421. <<__Native>>
  422. function xmlwriter_end_element(resource $xmlwriter): bool;
  423. /* End the current xml element. Writes an end tag even if the element is
  424. * empty.
  425. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  426. * This resource comes from a call to xmlwriter_open_uri() or
  427. * xmlwriter_open_memory().
  428. * @return bool - Returns TRUE on success or FALSE on failure.
  429. */
  430. <<__Native>>
  431. function xmlwriter_full_end_element(resource $xmlwriter): bool;
  432. /* Starts a namespaced attribute.
  433. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  434. * This resource comes from a call to xmlwriter_open_uri() or
  435. * xmlwriter_open_memory().
  436. * @param string $prefix - The namespace prefix.
  437. * @param string $name - The attribute name.
  438. * @param string $uri - The namespace URI.
  439. * @return bool - Returns TRUE on success or FALSE on failure.
  440. */
  441. <<__Native>>
  442. function xmlwriter_start_attribute_ns(resource $xmlwriter,
  443. string $prefix,
  444. string $name,
  445. string $uri): bool;
  446. /* Starts an attribute.
  447. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  448. * This resource comes from a call to xmlwriter_open_uri() or
  449. * xmlwriter_open_memory().
  450. * @param string $name - The attribute name.
  451. * @return bool - Returns TRUE on success or FALSE on failure.
  452. */
  453. <<__Native>>
  454. function xmlwriter_start_attribute(resource $xmlwriter,
  455. string $name): bool;
  456. /* Writes a full namespaced attribute.
  457. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  458. * This resource comes from a call to xmlwriter_open_uri() or
  459. * xmlwriter_open_memory().
  460. * @param string $prefix - The namespace prefix.
  461. * @param string $name - The attribute name.
  462. * @param string $uri - The namespace URI.
  463. * @param string $content - The attribute value.
  464. * @return bool - Returns TRUE on success or FALSE on failure.
  465. */
  466. <<__Native>>
  467. function xmlwriter_write_attribute_ns(resource $xmlwriter,
  468. string $prefix,
  469. string $name,
  470. string $uri,
  471. string $content): bool;
  472. /* Writes a full attribute.
  473. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  474. * This resource comes from a call to xmlwriter_open_uri() or
  475. * xmlwriter_open_memory().
  476. * @param string $name - The name of the attribute.
  477. * @param string $value - The value of the attribute.
  478. * @return bool - Returns TRUE on success or FALSE on failure.
  479. */
  480. <<__Native>>
  481. function xmlwriter_write_attribute(resource $xmlwriter,
  482. string $name,
  483. string $value): bool;
  484. /* Ends the current attribute.
  485. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  486. * This resource comes from a call to xmlwriter_open_uri() or
  487. * xmlwriter_open_memory().
  488. * @return bool - Returns TRUE on success or FALSE on failure.
  489. */
  490. <<__Native>>
  491. function xmlwriter_end_attribute(resource $xmlwriter): bool;
  492. /* Starts a CDATA.
  493. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  494. * This resource comes from a call to xmlwriter_open_uri() or
  495. * xmlwriter_open_memory().
  496. * @return bool - Returns TRUE on success or FALSE on failure.
  497. */
  498. <<__Native>>
  499. function xmlwriter_start_cdata(resource $xmlwriter): bool;
  500. /* Writes a full CDATA.
  501. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  502. * This resource comes from a call to xmlwriter_open_uri() or
  503. * xmlwriter_open_memory().
  504. * @param string $content - The contents of the CDATA.
  505. * @return bool - Returns TRUE on success or FALSE on failure.
  506. */
  507. <<__Native>>
  508. function xmlwriter_write_cdata(resource $xmlwriter,
  509. string $content): bool;
  510. /* Ends the current CDATA section.
  511. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  512. * This resource comes from a call to xmlwriter_open_uri() or
  513. * xmlwriter_open_memory().
  514. * @return bool - Returns TRUE on success or FALSE on failure.
  515. */
  516. <<__Native>>
  517. function xmlwriter_end_cdata(resource $xmlwriter): bool;
  518. /* Starts a comment.
  519. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  520. * This resource comes from a call to xmlwriter_open_uri() or
  521. * xmlwriter_open_memory().
  522. * @return bool - Returns TRUE on success or FALSE on failure.
  523. */
  524. <<__Native>>
  525. function xmlwriter_start_comment(resource $xmlwriter): bool;
  526. /* Writes a full comment.
  527. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  528. * This resource comes from a call to xmlwriter_open_uri() or
  529. * xmlwriter_open_memory().
  530. * @param string $content - The contents of the comment.
  531. * @return bool - Returns TRUE on success or FALSE on failure.
  532. */
  533. <<__Native>>
  534. function xmlwriter_write_comment(resource $xmlwriter,
  535. string $content): bool;
  536. /* Ends the current comment.
  537. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  538. * This resource comes from a call to xmlwriter_open_uri() or
  539. * xmlwriter_open_memory().
  540. * @return bool - Returns TRUE on success or FALSE on failure.
  541. */
  542. <<__Native>>
  543. function xmlwriter_end_comment(resource $xmlwriter): bool;
  544. /* Ends the current document.
  545. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  546. * This resource comes from a call to xmlwriter_open_uri() or
  547. * xmlwriter_open_memory().
  548. * @return bool - Returns TRUE on success or FALSE on failure.
  549. */
  550. <<__Native>>
  551. function xmlwriter_end_document(resource $xmlwriter): bool;
  552. /* Starts a processing instruction tag.
  553. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  554. * This resource comes from a call to xmlwriter_open_uri() or
  555. * xmlwriter_open_memory().
  556. * @param string $target - The target of the processing instruction.
  557. * @return bool - Returns TRUE on success or FALSE on failure.
  558. */
  559. <<__Native>>
  560. function xmlwriter_start_pi(resource $xmlwriter,
  561. string $target): bool;
  562. /* Writes a processing instruction.
  563. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  564. * This resource comes from a call to xmlwriter_open_uri() or
  565. * xmlwriter_open_memory().
  566. * @param string $target - The target of the processing instruction.
  567. * @param string $content - The content of the processing instruction.
  568. * @return bool - Returns TRUE on success or FALSE on failure.
  569. */
  570. <<__Native>>
  571. function xmlwriter_write_pi(resource $xmlwriter,
  572. string $target,
  573. string $content): bool;
  574. /* Ends the current processing instruction.
  575. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  576. * This resource comes from a call to xmlwriter_open_uri() or
  577. * xmlwriter_open_memory().
  578. * @return bool - Returns TRUE on success or FALSE on failure.
  579. */
  580. <<__Native>>
  581. function xmlwriter_end_pi(resource $xmlwriter): bool;
  582. /* Writes a text.
  583. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  584. * This resource comes from a call to xmlwriter_open_uri() or
  585. * xmlwriter_open_memory().
  586. * @param string $content - The contents of the text.
  587. * @return bool - Returns TRUE on success or FALSE on failure.
  588. */
  589. <<__Native>>
  590. function xmlwriter_text(resource $xmlwriter,
  591. string $content): bool;
  592. /* Writes a raw xml text.
  593. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  594. * This resource comes from a call to xmlwriter_open_uri() or
  595. * xmlwriter_open_memory().
  596. * @param string $content - The text string to write.
  597. * @return bool - Returns TRUE on success or FALSE on failure.
  598. */
  599. <<__Native>>
  600. function xmlwriter_write_raw(resource $xmlwriter,
  601. string $content): bool;
  602. /* Starts a DTD.
  603. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  604. * This resource comes from a call to xmlwriter_open_uri() or
  605. * xmlwriter_open_memory().
  606. * @param string $qualifiedname - The qualified name of the document type to
  607. * create.
  608. * @param string $publicid - The external subset public identifier.
  609. * @param string $systemid - The external subset system identifier.
  610. * @return bool - Returns TRUE on success or FALSE on failure.
  611. */
  612. <<__Native>>
  613. function xmlwriter_start_dtd(resource $xmlwriter,
  614. string $qualifiedname,
  615. ?string $publicid = "",
  616. ?string $systemid = ""): bool;
  617. /* Writes a full DTD.
  618. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  619. * This resource comes from a call to xmlwriter_open_uri() or
  620. * xmlwriter_open_memory().
  621. * @param string $name - The DTD name.
  622. * @param string $publicid - The external subset public identifier.
  623. * @param string $systemid - The external subset system identifier.
  624. * @param string $subset - The content of the DTD.
  625. * @return bool - Returns TRUE on success or FALSE on failure.
  626. */
  627. <<__Native>>
  628. function xmlwriter_write_dtd(resource $xmlwriter,
  629. string $name,
  630. ?string $publicid = "",
  631. ?string $systemid = "",
  632. ?string $subset = ""): bool;
  633. /* Starts a DTD element.
  634. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  635. * This resource comes from a call to xmlwriter_open_uri() or
  636. * xmlwriter_open_memory().
  637. * @param string $qualifiedname - The qualified name of the document type to
  638. * create.
  639. * @return bool - Returns TRUE on success or FALSE on failure.
  640. */
  641. <<__Native>>
  642. function xmlwriter_start_dtd_element(resource $xmlwriter,
  643. string $qualifiedname): bool;
  644. /* Writes a full DTD element.
  645. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  646. * This resource comes from a call to xmlwriter_open_uri() or
  647. * xmlwriter_open_memory().
  648. * @param string $name - The name of the DTD element.
  649. * @param string $content - The content of the element.
  650. * @return bool - Returns TRUE on success or FALSE on failure.
  651. */
  652. <<__Native>>
  653. function xmlwriter_write_dtd_element(resource $xmlwriter,
  654. string $name,
  655. string $content): bool;
  656. /* Ends the current DTD element.
  657. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  658. * This resource comes from a call to xmlwriter_open_uri() or
  659. * xmlwriter_open_memory().
  660. * @return bool - Returns TRUE on success or FALSE on failure.
  661. */
  662. <<__Native>>
  663. function xmlwriter_end_dtd_element(resource $xmlwriter): bool;
  664. /* Starts a DTD attribute list.
  665. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  666. * This resource comes from a call to xmlwriter_open_uri() or
  667. * xmlwriter_open_memory().
  668. * @param string $name - The attribute list name.
  669. * @return bool - Returns TRUE on success or FALSE on failure.
  670. */
  671. <<__Native>>
  672. function xmlwriter_start_dtd_attlist(resource $xmlwriter,
  673. string $name): bool;
  674. /* Writes a DTD attribute list.
  675. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  676. * This resource comes from a call to xmlwriter_open_uri() or
  677. * xmlwriter_open_memory().
  678. * @param string $name - The name of the DTD attribute list.
  679. * @param string $content - The content of the DTD attribute list.
  680. * @return bool - Returns TRUE on success or FALSE on failure.
  681. */
  682. <<__Native>>
  683. function xmlwriter_write_dtd_attlist(resource $xmlwriter,
  684. string $name,
  685. string $content): bool;
  686. /* Ends the current DTD attribute list.
  687. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  688. * This resource comes from a call to xmlwriter_open_uri() or
  689. * xmlwriter_open_memory().
  690. * @return bool - Returns TRUE on success or FALSE on failure.
  691. */
  692. <<__Native>>
  693. function xmlwriter_end_dtd_attlist(resource $xmlwriter): bool;
  694. /* Starts a DTD entity.
  695. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  696. * This resource comes from a call to xmlwriter_open_uri() or
  697. * xmlwriter_open_memory().
  698. * @param string $name - The name of the entity.
  699. * @param bool $isparam
  700. * @return bool - Returns TRUE on success or FALSE on failure.
  701. */
  702. <<__Native>>
  703. function xmlwriter_start_dtd_entity(resource $xmlwriter,
  704. string $name,
  705. bool $isparam): bool;
  706. /* Writes a full DTD entity.
  707. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  708. * This resource comes from a call to xmlwriter_open_uri() or
  709. * xmlwriter_open_memory().
  710. * @param string $name - The name of the entity.
  711. * @param string $content - The content of the entity.
  712. * @param bool $pe
  713. * @param string $publicid
  714. * @param string $systemid
  715. * @param string $ndataid
  716. * @return bool - Returns TRUE on success or FALSE on failure.
  717. */
  718. <<__Native>>
  719. function xmlwriter_write_dtd_entity(resource $xmlwriter,
  720. string $name,
  721. string $content,
  722. bool $pe = false,
  723. string $publicid = "",
  724. string $systemid = "",
  725. string $ndataid = ""): bool;
  726. /* Ends the current DTD entity.
  727. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  728. * This resource comes from a call to xmlwriter_open_uri() or
  729. * xmlwriter_open_memory().
  730. * @return bool - Returns TRUE on success or FALSE on failure.
  731. */
  732. <<__Native>>
  733. function xmlwriter_end_dtd_entity(resource $xmlwriter): bool;
  734. /* Ends the DTD of the document.
  735. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  736. * This resource comes from a call to xmlwriter_open_uri() or
  737. * xmlwriter_open_memory().
  738. * @return bool - Returns TRUE on success or FALSE on failure.
  739. */
  740. <<__Native>>
  741. function xmlwriter_end_dtd(resource $xmlwriter): bool;
  742. /* Flushes the current buffer.
  743. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  744. * This resource comes from a call to xmlwriter_open_uri() or
  745. * xmlwriter_open_memory().
  746. * @param bool $empty - Whether to empty the buffer or no. Default is TRUE.
  747. * @return mixed - If you opened the writer in memory, this function returns
  748. * the generated XML buffer, Else, if using URI, this function will write the
  749. * buffer and return the number of written bytes.
  750. */
  751. <<__Native>>
  752. function xmlwriter_flush(resource $xmlwriter,
  753. ?bool $empty = true): mixed;
  754. /* Returns the current buffer.
  755. * @param object $xmlwriter - The XMLWriter resource that is being modified.
  756. * This resource comes from a call to xmlwriter_open_uri() or
  757. * xmlwriter_open_memory().
  758. * @param bool $flush - Whether to flush the output buffer or no. Default is
  759. * TRUE.
  760. * @return string - Returns the current buffer as a string.
  761. */
  762. <<__Native>>
  763. function xmlwriter_output_memory(resource $xmlwriter,
  764. ?bool $flush = true): string;