Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - XSL Pattern vs. XPath [Thread Next] Re: XSL Pattern vs. XPathTo: NULL Date: 11/17/2009 12:15:00 PM Richard M. Hartman wrote: > Trying to figure out selectSingleNode(). The query syntax can be either > "XPath" or "XSL Pattern". Not finding any good comparisons of the two > syntaxes. What I really want to know is if you can do a case-insensitive > search with selectSingleNode() ... so far it seems to be case sensitive. XPath 1.0 is a W3C standard since 1999, consider to use that. It is the only option available with MSXML 4, 5, 6 anyway. Only MSXML 3 supports both XPath and XSL pattern but I don't think Microsoft has any documentation of that XSL pattern language which was implemented before XPath became a standard in 1999. As for case-insensitive search, element and attribute names in XML are case sensitive, so XPath is too when it comes to element and attribute names. If you want to compare string values in a case insensitive manner then the extension function ms:string-compare http://msdn.microsoft.com/en-us/library/ms256114.aspx has an option to do that. It should be supported in MSXML 6: var doc = new ActiveXObject('Msxml2.DOMDocument.6.0'); doc.loadXML('<root><foo>bar</foo><foo>BAR</foo><foo>baz</foo></root>'); doc.setProperty('SelectionLanguage', 'XPath'); doc.setProperty('SelectionNamespaces', 'xmlns:ms="urn:schemas-microsoft-com:xslt"'); doc.selectNodes('root/foo[ms:string-compare(., "bar", "", "i") = 0]').length -- Martin Honnen --- MVP XML http://msmvps.com/blogs/martin_honnen/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
