0
我想獲得一個xpath表達式的值使用SelectSingleNode小寫,是否有一個Xpath,可以給我一個評估xpath表達式的小寫值?SelectSingleNode來評估LowerCase節點集值
有可能通過有一個xsl轉換表,但它可能與下面?
該函數期望具有nodeset類型,下面評估爲字符串,從而引發異常。是否有可能返回的字符串轉換爲節點集做出的SelectSingleNode快樂
string xml = "<bac><test>Val</test></bac>";
string xpath = "/bac/test/text()";
var transpath = "translate(/bac/test/text(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')";
StringReader sReader = new StringReader(xml);
XmlReader xReader = new XmlTextReader(sReader);
XPathDocument xmlPathDoc = new XPathDocument(xReader);
XPathNavigator nav = xmlPathDoc.CreateNavigator();
XPathNodeIterator nodeIterator = nav.Select("/");
XPathNavigator navNode = nodeIterator.Current;
var v = navNode.SelectSingleNode(transpath).Value;
// expect val