protected function FieldRdfaTestBase::parseContent in Drupal 9
Same name and namespace in other branches
- 8 core/modules/rdf/tests/src/Kernel/Field/FieldRdfaTestBase.php \Drupal\Tests\rdf\Kernel\Field\FieldRdfaTestBase::parseContent()
- 10 core/modules/rdf/tests/src/Kernel/Field/FieldRdfaTestBase.php \Drupal\Tests\rdf\Kernel\Field\FieldRdfaTestBase::parseContent()
Parses a content and return the html element.
Parameters
string $content: The html to parse.
Return value
array An array containing simplexml objects.
1 call to FieldRdfaTestBase::parseContent()
- FieldRdfaTestBase::xpathContent in core/
modules/ rdf/ tests/ src/ Kernel/ Field/ FieldRdfaTestBase.php - Performs an xpath search on a certain content.
File
- core/
modules/ rdf/ tests/ src/ Kernel/ Field/ FieldRdfaTestBase.php, line 138
Class
Namespace
Drupal\Tests\rdf\Kernel\FieldCode
protected function parseContent($content) {
$htmlDom = new \DOMDocument();
@$htmlDom
->loadHTML('<?xml encoding="UTF-8">' . $content);
$elements = simplexml_import_dom($htmlDom);
return $elements;
}