Groups | Blog | Home
all groups > c# > july 2005 >

c# : GetElementsByTagName() function to be case insensitive


Nikhil Ekke
7/12/2005 11:52:28 PM
Hi,

I am parsing an XML file.
I am using the function GetElementsByTagName() function.
But I want this function to give me the XMLNodeList which is case
insensitive.

Suppose there r nodes like this
<time/>
<Time/>
<TimE/>

it shd return all of the above.
Can somebody pl. help me

Regards,
Nikhil



Rushi
7/13/2005 2:45:27 AM
Hi,

I don't think your problem will be solved.

An object of XMLDocument is performing GetElementsByTagName() by
passing XPath Query to XML Document. Now this XPath is by default not
casesensitive.

Thanks
Rushi
Steve Walker
7/13/2005 11:25:30 AM
In message <OmxFwd3hFHA.2484@TK2MSFTNGP15.phx.gbl>, Nikhil Ekke
<ekke_nikhil@yahoo.co.uk> writes
[quoted text, click to view]

You can't.

Use System.Text.RegularExpressions.Regex.Replace() to do a case
insensitive search and replace on the raw xml string. Then load it into
an XMLDocument.

--
AddThis Social Bookmark Button