2declare( strict_types = 1 );
9use Wikimedia\Parsoid\DOM\Document;
10use Wikimedia\Parsoid\DOM\DocumentFragment;
11use Wikimedia\Parsoid\DOM\Element;
12use Wikimedia\Parsoid\DOM\Node;
13use Wikimedia\Parsoid\Utils\DOMCompat;
31 $contentHolder = $po->getContentHolder();
33 $contentHolder->createFragment();
61 Document $doc,
string $name, array $attribs = [], Node|
string ...$children
63 $el = $doc->createElement( $name );
64 foreach ( $attribs as $key => $value ) {
65 $el->setAttribute( $key, $value );
67 DOMCompat::append( $el, ...$children );
OutputTransformStages that modify the content as a HTML DOM tree.
createElement(Document $doc, string $name, array $attribs=[], Node|string ... $children)
Helper method for DOM transforms to easily create DOM Elements with the given attributes and children...
transform(ParserOutput $po, ParserOptions $popts, array &$options)
Transforms the input ParserOutput into the returned ParserOutput.The returned ParserOutput can explic...
transformDOM(DocumentFragment $df, ParserOutput $po, ParserOptions $popts, array &$options)
Applies the transformation to a DOM document.