For an ASP.NET project I wrote a controller action and a form where the user can enter an xpath expression and retrieve the result from an xml file on the server. It works fine, even with some string functions like concat, substring-before and substring-after.
To get rid of some commas in the output, I tried to use string-join and tokenize. However, by using one of these functions I end up with an XPathException.
XPathDocument doc = new XPathDocument(@"C:\temp.xml");
XPathNavigator navigator = doc.CreateNavigator();
XmlNamespaceManager nsmgr = new XmlNamespaceManager(navigator.NameTable);
nsmgr.AddNamespace("x", "systemInfo");
var temp = navigator.Evaluate("string-join(tokenize('The quick brown fox', ' '), ';')", nsmgr); // Exception
Did I use these xpath functions not correctly?