Skip to content

Core\Xml\Writer

Builds a new XML document one node at a time. Core\Xml::writer returns a writer. startDocument begins the document, and endDocument returns it as a string. Between them, startElement and endElement open and close each element. The writer escapes every text and every attribute value for you, and it throws a LogicError for any call that would make the document invalid.

Returned by

You get a Core\Xml\Writer from these methods:

Members

10 members.

MemberSignature
startDocumentstartDocument(): void
endDocumentendDocument(): string
startElementstartElement(string $name): void
endElementendElement(): void
writeTextwriteText(string $text): void
writeAttributewriteAttribute(string $name, string $value): void
writeCommentwriteComment(string $text): void
writeCdatawriteCdata(string $text): void
writeInstructionwriteInstruction(string $target, string $data): void
writeDoctypewriteDoctype(string $name): void