array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'class.xmlwriter.php', 1 => 'XMLWriter', ), 'up' => array ( 0 => 'book.xmlwriter.php', 1 => 'XMLWriter', ), 'prev' => array ( 0 => 'example.xmlwriter-oop.php', 1 => 'Working with the OO API', ), 'next' => array ( 0 => 'xmlwriter.endattribute.php', 1 => 'XMLWriter::endAttribute', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/xmlwriter/xmlwriter.xml', ), 'history' => array ( ), 'extra_header_links' => array ( 'rel' => 'alternate', 'href' => '/manual/en/feeds/class.xmlwriter.atom', 'type' => 'application/atom+xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

The XMLWriter class

(PHP 5 >= 5.1.2, PHP 7, PHP 8, PECL xmlwriter >= 0.1.0)

Introduction

Class synopsis

class XMLWriter {
/* Methods */
public endAttribute(): bool
public endCdata(): bool
public endComment(): bool
public endDocument(): bool
public endDtd(): bool
public endDtdEntity(): bool
public endElement(): bool
public endPi(): bool
public flush(bool $empty = true): string|int
public openMemory(): bool
public openUri(string $uri): bool
public outputMemory(bool $flush = true): string
public setIndent(bool $enable): bool
public setIndentString(string $indentation): bool
public startAttribute(string $name): bool
public startAttributeNs(?string $prefix, string $name, ?string $namespace): bool
public startCdata(): bool
public startComment(): bool
public startDocument(?string $version = "1.0", ?string $encoding = null, ?string $standalone = null): bool
public startDtd(string $qualifiedName, ?string $publicId = null, ?string $systemId = null): bool
public startDtdAttlist(string $name): bool
public startDtdElement(string $qualifiedName): bool
public startDtdEntity(string $name, bool $isParam): bool
public startElement(string $name): bool
public startElementNs(?string $prefix, string $name, ?string $namespace): bool
public startPi(string $target): bool
public text(string $content): bool
public writeAttribute(string $name, string $value): bool
public writeAttributeNs(
    ?string $prefix,
    string $name,
    ?string $namespace,
    string $value
): bool
public writeCdata(string $content): bool
public writeComment(string $content): bool
public writeDtd(
    string $name,
    ?string $publicId = null,
    ?string $systemId = null,
    ?string $content = null
): bool
public writeDtdAttlist(string $name, string $content): bool
public writeDtdElement(string $name, string $content): bool
public writeDtdEntity(
    string $name,
    string $content,
    bool $isParam = false,
    ?string $publicId = null,
    ?string $systemId = null,
    ?string $notationData = null
): bool
public writeElement(string $name, ?string $content = null): bool
public writeElementNs(
    ?string $prefix,
    string $name,
    ?string $namespace,
    ?string $content = null
): bool
public writePi(string $target, string $content): bool
public writeRaw(string $content): bool
}

Table of Contents