error_reporting = E_ALL & ~E_DEPRECATED
<xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
...
<xsl:variable name="nName" select="translate(name(.), $uppercase, $smallcase)"/>
...
//li[div/a][1]/
following-sibling::li[div/a][1]/
preceding-sibling::li[
preceding-sibling::li[div/a]
]
$doc = new DomDocument('1.0', 'utf-8');
$doc->loadXml($text);
$xp = new DomXPath($doc);
foreach ($xp->query('//src') as $src_node) {
$pre_node = $doc->createElement('pre');
$pre_node->appendChild($src_node);
$src_node->parentNode->replaceChild($pre_node, $src_node);
};
$new_text = $doc->saveXML();