How can I change a given xpath string only for nodes that exist in a specific XML document
I am building an xpath string based on all filled fields in a user submitted form. In my XML document, not all form fields necessarily exist as nodes. When I try to do
doc.SelectNodes (XPath);
I am getting System.Xml.XPath.XPathException that my xpath has an invalid token.
How can I change the xpath string to include only those fields that exist in the XML document and ignore all others?
0
a source to share