function FieldRdfaTestBase::parseContent
Same name in other branches
- 9 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 147
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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.