Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of XMLWriter extended by PHP

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces the example analysis of XMLWriter extended by PHP, which is very detailed and has certain reference value. Friends who are interested must finish it!

I. Overview and installation

This is the XMLWriter extension. It wraps the libxml xmlWriter API.

This extension represents a writer that provides a non-cached, forward-only means of generating streams or files containing XML data.

This extension can be used in an object oriented style or a procedural one. Every method documented describes the alternative procedural call.

This extension requires a libxml PHP extension. This means that you need to use-- enable-libxml, although this will be done implicitly because libxml is enabled by default.

The XMLWriter extension was initially a PECL extension for PHP 5. It was later added to the PHP source (bundled) as of PHP 5.1.2. This extension is enabled by default.

This extension is enabled by default and can be disabled at compile time with the following options:-- disable-xmlwriter

Second, the XMLWriter class and its member functions

XMLWriter::endAttribute-End attribute

XMLWriter::endCData-End current CDATA

XMLWriter::endComment-Create end comment

XMLWriter::endDocument-End current document

XMLWriter::endDTDAttlist-End current DTD AttList

XMLWriter::endDTDElement-End current DTD element

XMLWriter::endDTDEntity-End current DTDEntity

XMLWriter::endDTD-End current DTD

XMLWriter::endElement-End current element

XMLWriter::endPI-End current PI

XMLWriter::flush-Flush current buffer

XMLWriter::fullEndElement-End current element

XMLWriter::openMemory-Create new xmlwriter using memory for string output

XMLWriter::openURI-Create new xmlwriter using source uri for output

XMLWriter::outputMemory-Returns current buffer

XMLWriter::setIndentString-Set string used for indenting

XMLWriter::setIndent-Toggle indentation on/off

XMLWriter::startAttributeNS-Create start namespaced attribute

XMLWriter::startAttribute-Create start attribute

XMLWriter::startCData-Create start CDATA tag

XMLWriter::startComment-Create start comment

XMLWriter::startDocument-Create document tag

XMLWriter::startDTDAttlist-Create startDTD AttList

XMLWriter::startDTDElement-Create startDTD element

XMLWriter::startDTDEntity-Create startDTDEntity

XMLWriter::startDTD-Create startDTD tag

XMLWriter::startElementNS-Create start namespaced element tag

XMLWriter::startElement-Create start element tag

XMLWriter::startPI-Create startPI tag

XMLWriter::text-Write text

XMLWriter::writeAttributeNS-Write full namespaced attribute

XMLWriter::writeAttribute-Write full attribute

XMLWriter::writeCData-Write full CDATA tag

XMLWriter::writeComment-Write full comment tag

XMLWriter::writeDTDAttlist-Write full DTD AttList tag

XMLWriter::writeDTDElement-Write full DTD element tag

XMLWriter::writeDTDEntity-Write full DTDEntity tag

XMLWriter::writeDTD-Write full DTD tag

XMLWriter::writeElementNS-Write full namespaced element tag

XMLWriter::writeElement-Write full element tag

XMLWriter::writePI-Writes a PI

XMLWriter::writeRaw-Write a raw XML text

The above is all the content of the article "sample Analysis of XMLWriter extended by PHP". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report