Case sensitive searches

wxdqz

New Member
Hi all,

Got a slight problem with my code which I'm hoping someone can shed a bit of light.

I have the following code...

function loadXML(xmlFile)
{
xmlDoc.async="false";
xmlDoc.onreadystatechange=verify;
xmlDoc.load(xmlFile);
xmlDoc.setProperty("SelectionLanguage", "XPath");
xmlObj=xmlDoc.documentElement;
}

function verifiyDistName(distName)
{
var matchedNodes = xmlDoc.selectNodes('//DistributionLists/List1/*[N="' + distName + '"]');
alert("Number of matched nodes: " + matchedNodes.length);
}

All work fine. I pass a value to verifyDistName, and if it's found in the XML, it returns a true. The problem is that it's case sensitive. Anyone know of a way to either convert the node data to one case, or disable case sensitivity.

The second part is a bit easier (I think!!).

I have another function, which is...

function verifiyDistID(distID)
{
var matchedNodes = xmlDoc.selectNodes('//DistributionLists/List1/[ID=' + distID + ']');
alert("Number of matched nodes: " + matchedNodes.length);
}


This is similar to the verifyDistName function, but uses an integer rather than a string.

What I need to do, is return the value of the "N" node, if ID is true.

An example of this would be...

<List1 DLN="Full">
<member>
<ID>05405</ID>
<N>Derrick Hale</N>
<L>2</L>
</member>
<member>
<ID>5660</ID>
<N>William A Pound</N>
<L>2</L>
</member>
<member>
<ID>5790</ID>
<N>Cheryl Blair</N>
<L>2</L>
</member>
</List1>

So if I ran the function verifyDistID(5660), I would get returned "William A Pound"

ANY help really would be appreciated as I've been banging my head with this for hours...!

TIA
 
Back
Top