You are currently offline, waiting for your internet to reconnect

Your browser is out-of-date

You need to update your browser to use the site.

Update to the latest version of Internet Explorer

INFO: Use XPath to Perform a Case-Insensitive Search with MSXML

This article was previously published under Q315719
MSXML includes two functions that you can use to filter data in a case-insensitive search. With MSXML 3.0, you can use the translate function. With MSXML 4.0, you can use either the translate function or the new ms:string-compare XPath function.
To perform a case-insensitive search by a DomainName property that is named "" on the following XML data
<?xml version="1.0" ?><Domains> <DomainName>Mydomain1.COM</DomainName></Domains>				
the syntax for translate in MSXML 3.0 is as follows:
oXML.setProperty "SelectionLanguage", "XPath"set node = oXML.selectSingleNode("Domains/DomainName[translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = '']")				
The syntax for ms:string-compare in MSXML 4.0 is as follows:
'To use MSXML 4.0, you need to use 4.0 dependent progid explicitly.' ...'Set the select namespace for xmlns:msoXML.setProperty "SelectionNamespaces", "xmlns:ms='urn:schemas-microsoft-com:xslt'"set node = oXML.selectSingleNode("Domains/DomainName[ms:string-compare(., '', 'en-US', 'i') = 0]")				
For more information about the translate and the ms:string-compare functions, see the XML Software Development Kit (SDK) documentation.

Article ID: 315719 - Last Review: 04/08/2002 11:53:00 - Revision: 1.1

  • Microsoft XML Parser 3.0
  • Microsoft XML Core Services 4.0
  • kbfile kbinfo KB315719