RE: [xsl] pattern matching possible?

Subject: RE: [xsl] pattern matching possible?
From: "Hardy Merrill" <HMerrill@xxxxxxxxxxxxxxxx>
Date: Thu, 13 May 2004 09:00:40 -0400
A co-worker of mine found the answer this morning on MS support site:

   http://support.microsoft.com/default.aspx?scid=kb;en-us;315719

Note that we *are* using MSXML 4.

Here's a snipped from that page:

SUMMARY
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. 

oXML.setProperty "SelectionLanguage", "XPath"
set node = oXML.selectSingleNode("Domains/DomainName[translate(.,
'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') =
'mydomain1.com']")
---------------------------------------------------------
So, going with the "translate" approach, all we had to do was add this
line:

     oXML.setProperty "SelectionLanguage", "XPath"

and then our translate worked fine.

Thanks for the input.

Hardy Merrill

>>> John.Hansen@xxxxxxxxxx 05/12/04 04:40PM >>>
This error indicates that you are not using DOMDocument40 but, rather,
an earlier version (DOMDocument30 pssibly) which uses Microsoft's old
XSL language (by default) rather than the standard XSL language.

-----Original Message-----
From: Hardy Merrill [mailto:HMerrill@xxxxxxxxxxxxxxxx] 
Sent: Wednesday, May 12, 2004 3:23 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx; davidc@xxxxxxxxx 
Subject: Re: [xsl] pattern matching possible?


Sorry for the top post - thank Groupwise :(

I can't get 'translate' to work - this code (and many other similar
versions):

--------------------------------
    Dim a
    a =
"applications/application/acronym[translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXY
Z','abcdefghijklmnopqrstuvwxyz')='"
& LCase(sNodeText) & "']"
   oDupNodes = Session("Applications").selectNodes(a)

-------------------------------

produces this ASP error:

Unknown method.
applications/application/acronym[-->translate(.<--,'ABCDEFGHIJKLMNOPQRST
UVWXYZ','abcdefghijklmnopqrstuvwxyz')='asap']


Any ideas?  Notice that it doesn't seem to like the 'translate'
function.

TIA.

Hardy Merrill

Current Thread