<?php
$html='<ul><li id="m1"></li></ul>';
$doctype = '<!DOCTYPE id [
<!ATTLIST li id ID #IMPLIED>
]>';
$domdocument=new domDocument('1.0','utf-8');
$domdocument->loadXML($doctype . $html);
echo $domdocument->getElementById("m1")->tagName;
?>
<?php
$html='<ul><li xml:id="m1"></li></ul>';
$domdocument=new domDocument('1.0','utf-8');
$domdocument->loadXML($html);
echo $domdocument->getElementById("m1")->tagName;
?>
<?php
$html='<ul><li id="m1"></li></ul>';
$domdocument=new domDocument('1.0','utf-8');
$domdocument->loadXML($html);
$rng = '
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start>
<element>
<anyName/>
<ref name="anythingID"/>
</element>
</start>
<define name="anythingID">
<zeroOrMore>
<choice>
<element>
<anyName/>
<ref name="anythingID"/>
</element>
<attribute name="id">
<data type="ID"/>
</attribute>
<zeroOrMore>
<attribute><anyName/></attribute>
</zeroOrMore>
<text/>
</choice>
</zeroOrMore>
</define>
</grammar>
';
$domdocument->relaxNGValidateSource($rng);
echo $domdocument->getElementById("m1")->tagName;
?>
<?php
$html='<ul><li id="m1"></li></ul>';
$domdocument=new domDocument('1.0','utf-8');
$domdocument->loadXML($html);
$xpath = new DOMXPath($domdocument);
echo $xpath->query("//*[@id='m1']")->item(0)->tagName;
?>
Если Вы уже зарегистрированы на Портале - войдите в систему, если Вы еще не регистрировались - пройдите простую процедуру регистрации.