Jump to content

oach

New Members
  • Posts

    2
  • Joined

  • Last visited

oach's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. There are back-to-back warnings on the $node->xpath($path) call. Warning: SimpleXMLElement::xpath(): Invalid expression in /var/www/html/test/xml.php on line... arning: SimpleXMLElement::xpath(): xmlXPathEval: evaluation failed in /var/www/html/test/xml.php on line... The test file is trying to mimic what is happening in production in an easy to reproduce situation.
  2. Hello All, I have searched these forums and the net but haven't found an exact answer. I have a "path" (could be paths) that is/are causing warnings as it/they is/are poorly formed. This is bloating our logs, therefore I need to alleviate the issue. There are thousands of paths in the database so I do not know which are causing issues. I know I can add the "@" to the call to quiet the warning. First question: does that keep the warning from going into the logs? I would prefer not to use the method above as it bypasses the real issue. Looking at the SimpleXMLElement documentation along with DOMDocument and DOMXPAth, I can't find a way to validate the actual path. All of the below throw a warning or notice: $xpath->evaluate($path); $xpath->query($path); $node->xpath($path); Final question: Is there a "simple" way to validate the $path prior to actually making the call to one of the methods of the various XML PHP classes? Thank you for your time and assistance.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.