c# - How to detect that an XPATH expression is correct? -


is there way (regex or similar, c# preferred) detect if xpath expression correct before using it?

i have been googling time , nothing seems appear.

thanks in advance! carlos.

try , if there thrown xpathexception, mean xpath syntactically wrong.

xmldocument doc = new xmldocument(); xpathnavigator nav = doc.createnavigator();  try  {   var res = nav.compile(xpath);    // ... } catch (xpathexception e) {   // handle exception } 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -