I'm trying to get html tags that start with uppercase using DOMDocument in PHP 5.3.
I'm using a php function registered in XPath to test it, but the function is receiving as first parameters tagNames in lowercase.
The xml:
<test>
<A>Match this</A>
<b>Dont match this</b>
</test>
The php function:
...
public function isUpper($name) {
return (bool)preg_match('/^[A-Z]/', $name);
}
...
Ant this is the Xpath:
//*[php:function("\Cdr\Dom\DOMXPath::isUpper", name())]
the function isUpper receives $name in lowercase so it don't works.
My questions are:
- Why isn't case sensitive?
- There is a better way to do this?