Daniel wrote:
EXSLT.NET has nothing to support regular expressions inside of xpath for
System.Xml.XmlNode xpath methods such as SelectNodes or SelectSingleNode
These methods are just wrappers around XPathNavigator.Select() method
and you are right, they are useless with EXSLT.NET. Use XPathNavigator
instead. Here is a sample how to use EXSLT function with XmlDocument and
XPath.
XmlDocument doc = new XmlDocument();
doc.Load("foo.xml");
XPathNavigator nav = doc.CreateNavigator();
XPathExpression expr = nav.Compile("set:distinct(//@country)");
expr.SetContext(new ExsltContext(doc.NameTable));
XPathNodeIterator ni = nav.Select(expr);
while (ni.MoveNext()) {
Console.WriteLine(ni.Current.Value);
}
--
Oleg Tkachenko [XML MVP, MCAD]
http://www.XmlLab.Net |
http://www.XLinq.Net |
http://blog.tkachenko.com