I'm trying to get the line number of a DOMElement object in PHP - the documentati开发者_如何学Pythonon says DOMElement extends DOMNode which implements the getLineNo() method, however, when I try to use this method I get:
Fatal error: Call to undefined method DOMElement::getLineNo()
Upgrade to PHP 5.3 or higher, see the documentation. On a side note: dynamically added nodes (i.e. not in the XML document or string on load) will return 0
.
精彩评论