473,396 Members | 2,039 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Case Sensetive


Hi,

How can I make my query to return both "Bob" & "bob" (during search for a
string) ?

any idea?

thanks
Nov 12 '05 #1
7 2068
Hello,

You can try to use "translate" function to convert the string to low or
upper case before comparing. For example you could try to use something like
this:

....

<xsl:if test="translate(@name, 'ABCDEFGHIJKLMNOPSQRTUVWXYZ',
'abcdefghijklmnopsqrtuvwxyz') = 'bob'">

....

--
Thanks,
Eugene
-------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.


"C# newbie" <rs****@otxresearch.com> wrote in message
news:#J**************@TK2MSFTNGP12.phx.gbl...

Hi,

How can I make my query to return both "Bob" & "bob" (during search for a
string) ?

any idea?

thanks

Nov 12 '05 #2
Hi Eugene,

I always have used xml, wrapped into C#, how can I run it out of it ?
thanks for your help

c# newbie
"Eugene Bykov [MSFT]" <eu******@online.microsoft.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hello,

You can try to use "translate" function to convert the string to low or
upper case before comparing. For example you could try to use something like this:

...

<xsl:if test="translate(@name, 'ABCDEFGHIJKLMNOPSQRTUVWXYZ',
'abcdefghijklmnopsqrtuvwxyz') = 'bob'">

...

--
Thanks,
Eugene
-------------------------
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.


"C# newbie" <rs****@otxresearch.com> wrote in message
news:#J**************@TK2MSFTNGP12.phx.gbl...

Hi,

How can I make my query to return both "Bob" & "bob" (during search for a string) ?

any idea?

thanks


Nov 12 '05 #3
Could you please provide a part of your code so that I could better
understand your problem and provide you an example based on it?

--
Thanks,
Eugene
-------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
"C# newbie" <rs****@otxresearch.com> wrote in message
news:uJ**************@TK2MSFTNGP09.phx.gbl...
Hi Eugene,

I always have used xml, wrapped into C#, how can I run it out of it ?
thanks for your help

c# newbie
"Eugene Bykov [MSFT]" <eu******@online.microsoft.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hello,

You can try to use "translate" function to convert the string to low or
upper case before comparing. For example you could try to use something like
this:

...

<xsl:if test="translate(@name, 'ABCDEFGHIJKLMNOPSQRTUVWXYZ',
'abcdefghijklmnopsqrtuvwxyz') = 'bob'">

...

--
Thanks,
Eugene
-------------------------
This posting is provided "AS IS" with no warranties, and confers no

rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.


"C# newbie" <rs****@otxresearch.com> wrote in message
news:#J**************@TK2MSFTNGP12.phx.gbl...

Hi,

How can I make my query to return both "Bob" & "bob" (during search
for a string) ?

any idea?

thanks



Nov 12 '05 #4
Eugene, thanks for caring. I have an xml file and written a program which
finds strings/text into that xml file using SelectNode() & ...
As you will see there is a name like "Bob" or so many other data into the
xml file. I need to know how I can find a text or string into the xml file
regardless of what user enters. User may enter bob or Bob. I know there is a
translate finction as you said but dont know how to include it in my xpath
query which is:
//*[contains(.,"Bob")]

XML goes here:

<?xml version="1.0" encoding="ISO-8859-1"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<Params>
<BackgroundColor>#19384A</BackgroundColor>
<LinkColor>#ffffff</LinkColor>
<VisitedLinkColor>#ffffff</VisitedLinkColor>
<TextColor>#ffffff</TextColor>
<Direction>ltr</Direction>
<BackgroundImage></BackgroundImage>
<Header>&lt;table width='600' cellspacing='0' callpadding='0'
border='0' align='center'&gt; &lt;tr&gt;&lt;td&gt;&lt;img
src='images/ifilmtest.gif' alt='test' width='175'
height='62'&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br&gt;&lt;br&gt;
</Header><Footer>&lt;table align=center border='0' Width='600'&gt;
&lt;tr&gt;&lt;td width='50%'&gt;&lt;FONT
FACE='Arial,Helvetica' Size='1' COLOR='#FFFFFF'&gt;COPYRIGHT
&lt;script language='javascript'&gt;
document.write(String.fromCharCode(38));&lt;/script&gt;copy
2000 - 2004 test Co. All rights reserved.&lt;
/font&gt;&lt;/td&gt; &lt;td width='50%'
align='right'&gt;&lt;FONT FACE='Arial,Helvetica' Size='1'
COLOR='#FFFFFF'&gt;
Technical Problems? &lt;a
href='http://test.ifilm.com/support_form.asp'&gt;Contact Us, please
reference survey content
in the subject
line&lt;/a&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</Footer><CSS>survey.css</CSS>
<MouseOverMessage></MouseOverMessage>
</Params>
<artist>Bob</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Hide your heart</title>
<artist>Bob</artist>
<country>UK</country>
<company>CBS Records</company>
<price>9.90</price>
<year>1988</year>
</cd>

</catalog>
Thanks
C# NewBie

"Eugene Bykov [MSFT]" <eu******@online.microsoft.com> wrote in message
news:uE**************@tk2msftngp13.phx.gbl...
Could you please provide a part of your code so that I could better
understand your problem and provide you an example based on it?

--
Thanks,
Eugene
-------------------------
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
"C# newbie" <rs****@otxresearch.com> wrote in message
news:uJ**************@TK2MSFTNGP09.phx.gbl...
Hi Eugene,

I always have used xml, wrapped into C#, how can I run it out of it ? thanks for your help

c# newbie
"Eugene Bykov [MSFT]" <eu******@online.microsoft.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hello,

You can try to use "translate" function to convert the string to low or upper case before comparing. For example you could try to use
something like
this:

...

<xsl:if test="translate(@name, 'ABCDEFGHIJKLMNOPSQRTUVWXYZ',
'abcdefghijklmnopsqrtuvwxyz') = 'bob'">

...

--
Thanks,
Eugene
-------------------------
This posting is provided "AS IS" with no warranties, and confers no

rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.


"C# newbie" <rs****@otxresearch.com> wrote in message
news:#J**************@TK2MSFTNGP12.phx.gbl...
>
> Hi,
>
> How can I make my query to return both "Bob" & "bob" (during search

for
a
> string) ?
>
> any idea?
>
> thanks
>
>



Nov 12 '05 #5
C# newbie wrote:
Eugene, thanks for caring. I have an xml file and written a program which
finds strings/text into that xml file using SelectNode() & ...
As you will see there is a name like "Bob" or so many other data into the
xml file. I need to know how I can find a text or string into the xml file
regardless of what user enters. User may enter bob or Bob. I know there is a
translate finction as you said but dont know how to include it in my xpath
query which is:
//*[contains(.,"Bob")]


It's

//*[contains(translate(text(), 'ABCDEFGHIJKLMNOPSQRTUVWXYZ',
'abcdefghijklmnopsqrtuvwxyz'),'bob')]

Beware, that's obviously English only solution. If you under .NET, for
better i18n you can try EXSLT.NET [1] with it's function str2:lowercase().

[1] http://workspaces.gotdotnet.com/exslt
--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
Nov 12 '05 #6
Oleg,

Thanks but a message error comes up and complains about invalid tokens!
"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
C# newbie wrote:
Eugene, thanks for caring. I have an xml file and written a program which finds strings/text into that xml file using SelectNode() & ...
As you will see there is a name like "Bob" or so many other data into the xml file. I need to know how I can find a text or string into the xml file regardless of what user enters. User may enter bob or Bob. I know there is a translate finction as you said but dont know how to include it in my xpath query which is:
//*[contains(.,"Bob")]


It's

//*[contains(translate(text(), 'ABCDEFGHIJKLMNOPSQRTUVWXYZ',
'abcdefghijklmnopsqrtuvwxyz'),'bob')]

Beware, that's obviously English only solution. If you under .NET, for
better i18n you can try EXSLT.NET [1] with it's function str2:lowercase().

[1] http://workspaces.gotdotnet.com/exslt
--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com

Nov 12 '05 #7
C# newbie wrote:
Thanks but a message error comes up and complains about invalid tokens!

//*[contains(translate(text(), 'ABCDEFGHIJKLMNOPSQRTUVWXYZ',
'abcdefghijklmnopsqrtuvwxyz'),'bob')]


Expression is ok, so it must be some error in the code you didn't show us.

--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
Nov 12 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Ajay | last post by:
Hi I am trying to do the following. I have a set of records Example 1 Test 2 test 3 TEST 4 ACCESS 5 EXCEL
2
by: vulcaned | last post by:
Hi All, In access97 I have a query who's record source is a linked sql table and when I enter a value the Part nbr filed to select by (ex: A10295X ) I get back only records that have a case match....
5
by: Jeff S | last post by:
I'm getting started with C# and was just wondering if C# veterans LIKE the fact that the language is case sensitive. If so, how is case sensitivity helpful? Do you create multiple variables,...
15
by: Thomas Scheiderich | last post by:
I thought I read that the case for the variable names is important. For example Dim Wheel As Integer Wheel here is a different variable from WHEEL. Is this correct?
1
by: Agnes | last post by:
myGrid.mappingname = "Invoice" -> it doesn't work myGrid.mappingname = "invoice" -> it seems work . Case sensetive ?
10
by: Agnes | last post by:
I found that store procedure with vb.net (seems ignore case senstive) I type "lax" as code, and it returns the correct answer , How come ?? I can't set the upper case in that textbox, BUT I need...
2
by: A Bruce | last post by:
hello, I am attempting to convert a oracle database to postgresql and I am having some problems creating a constraint across multiple columns which are a mixture of case insensitive and case...
0
by: ambika_se | last post by:
Hi all I want to make a Xquery which is like this for $x in doc("file:///C:/Science.xml")//tva2:title where $x//node() return $x Its working perfectly but if i try for( biological science) its...
7
by: vunet.us | last post by:
So, I came across the problem every developer comes across with once: case in SQL. My users login with their selected user name and when SQL checks for user name value, case is ignored. For...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.