RemexHtml
Fast HTML 5 parser
|
The interface for classes that help Serializer to convert nodes to strings. More...
Public Member Functions | |
string | startDocument ( $fragmentNamespace, $fragmentName) |
Get a string which starts the document. | |
string | characters (SerializerNode $parent, $text, $start, $length) |
Encode the given character substring. | |
string | element (SerializerNode $parent, SerializerNode $node, $contents) |
Encode the given element. | |
string | comment (SerializerNode $parent, $text) |
Encode a comment. | |
string | doctype ( $name, $public, $system) |
Encode a doctype. | |
The interface for classes that help Serializer to convert nodes to strings.
Serializer assumes that the return values of these functions can be concatenated to make a document.
It is not safe to assume that the methods will be called in any particular order, or that the return values will actually be retained in the final Serializer result.
string Wikimedia\RemexHtml\Serializer\Formatter::characters | ( | SerializerNode | $parent, |
$text, | |||
$start, | |||
$length ) |
Encode the given character substring.
SerializerNode | $parent | The parent of the text node (at creation time) |
string | $text | |
int | $start | The offset within $text |
int | $length | The number of bytes within $text |
Implemented in Wikimedia\RemexHtml\Serializer\FastFormatter, Wikimedia\RemexHtml\Serializer\HtmlFormatter, and Wikimedia\RemexHtml\Serializer\TestFormatter.
string Wikimedia\RemexHtml\Serializer\Formatter::comment | ( | SerializerNode | $parent, |
$text ) |
Encode a comment.
SerializerNode | $parent | The parent of the node (at creation time) |
string | $text | The inner text of the comment |
Implemented in Wikimedia\RemexHtml\Serializer\FastFormatter, Wikimedia\RemexHtml\Serializer\HtmlFormatter, and Wikimedia\RemexHtml\Serializer\TestFormatter.
string Wikimedia\RemexHtml\Serializer\Formatter::doctype | ( | $name, | |
$public, | |||
$system ) |
Encode a doctype.
This event occurs when the source document has a doctype, it can return an empty string if the formatter wants to use its own doctype.
string | $name | The doctype name, usually "html" |
string | $public | The PUBLIC identifier |
string | $system | The SYSTEM identifier |
Implemented in Wikimedia\RemexHtml\Serializer\FastFormatter, Wikimedia\RemexHtml\Serializer\HtmlFormatter, and Wikimedia\RemexHtml\Serializer\TestFormatter.
string Wikimedia\RemexHtml\Serializer\Formatter::element | ( | SerializerNode | $parent, |
SerializerNode | $node, | ||
$contents ) |
Encode the given element.
SerializerNode | $parent | The parent of the node (when it is closed) |
SerializerNode | $node | The element to encode |
string | null | $contents | The previously-encoded contents, or null for a void element. Void elements can be serialized as self-closing tags. |
Implemented in Wikimedia\RemexHtml\Serializer\DepurateFormatter, Wikimedia\RemexHtml\Serializer\FastFormatter, Wikimedia\RemexHtml\Serializer\HtmlFormatter, and Wikimedia\RemexHtml\Serializer\TestFormatter.
string Wikimedia\RemexHtml\Serializer\Formatter::startDocument | ( | $fragmentNamespace, | |
$fragmentName ) |
Get a string which starts the document.
string | null | $fragmentNamespace | |
string | null | $fragmentName |
Implemented in Wikimedia\RemexHtml\Serializer\FastFormatter, Wikimedia\RemexHtml\Serializer\HtmlFormatter, and Wikimedia\RemexHtml\Serializer\TestFormatter.