nap0leon
06-10-2008, 11:17 AM
I've inherited an XML file that resembles this:
<ROOT>
<ROW state="AK" product="AAA" range="0TO100" customervalue="HIGH" optin="Y" />
<ROW state="AK" product="AAA" range="0TO100" customertype="MEDIUM" optin="N" />
<ROW state="AK" product="AAA" range="0TO100" customertype="LOW" optin="N" />
<ROW state="AK" product="AAA" range="125TO500" customervalue="HIGH" optin="Y" />
<ROW state="AK" product="AAA" range="125TO500" customertype="MEDIUM" optin="Y" />
<ROW state="AK" product="AAA" range="125TO500" customertype="LOW" optin="N" />
</ROOT>
In classic ASP, I need to be able to grab the value for the attribute "optin" wher the other 4 attributes are satisified. That is:
Give me the value for "value" where state="AK", product="AAA" , range="0TO100" and customervalue="HIGH"
If this were broken out into a better tree-structure with only 1 attribute per node, I could do it something like this:
strXPATH= "//State[@abbr='NC']//Product[@name='AAA']//Range[@range='0TO100']//Customertype[@type='HIGH']/optin"
But I've never messed with one this flat before. How do I search for a single node where multiple attibiutes satisfy my criteria?
Many thanks!
<ROOT>
<ROW state="AK" product="AAA" range="0TO100" customervalue="HIGH" optin="Y" />
<ROW state="AK" product="AAA" range="0TO100" customertype="MEDIUM" optin="N" />
<ROW state="AK" product="AAA" range="0TO100" customertype="LOW" optin="N" />
<ROW state="AK" product="AAA" range="125TO500" customervalue="HIGH" optin="Y" />
<ROW state="AK" product="AAA" range="125TO500" customertype="MEDIUM" optin="Y" />
<ROW state="AK" product="AAA" range="125TO500" customertype="LOW" optin="N" />
</ROOT>
In classic ASP, I need to be able to grab the value for the attribute "optin" wher the other 4 attributes are satisified. That is:
Give me the value for "value" where state="AK", product="AAA" , range="0TO100" and customervalue="HIGH"
If this were broken out into a better tree-structure with only 1 attribute per node, I could do it something like this:
strXPATH= "//State[@abbr='NC']//Product[@name='AAA']//Range[@range='0TO100']//Customertype[@type='HIGH']/optin"
But I've never messed with one this flat before. How do I search for a single node where multiple attibiutes satisfy my criteria?
Many thanks!