Sorry if this has been answered, I had a hard time search for 'and'.
I have an XML document (snippet below) and I am trying to retrieve the FREIGHTFEE's attributes based on the value of multiple elements, as follows. Actually, for now I'm just trying to locate the elements that meet my criteria:
varCompany = 01 AND
varCustomer = *ALL AND
varShip = STD AND
varSTATE= IL
I have tried:
doc.Query("/FREIGHT_XREF/COMPANIES[COMPANY=varComa pny]/COMPANY[CUSTOMER=varCus tomer]/CUSTOMER[VS_SHIP=varShip]/COUNTRY[STATE=varState]")
and various permutations thereof, with no success. Where am I going wrong?
<FREIGHT_XREF >
<COMPANIES>
<COMPANY>
01
<CUSTOMER>
*ALL
<VS_SHIP>
STD
<COUNTRY>
USA
<STATE>
*ALL
<FREIGHTFEE UPSCode="UPN" TOD="PPA" Value="12.00" />
</STATE>
<STATE>
IL
<FREIGHTFEE UPSCode="UGC" TOD="PPA" Value="4.00" />
</STATE>
<STATE>
HI
<FREIGHTFEE UPSCode="UP2" TOD="PPA" Value="10.00" />
</STATE>
</COUNTRY>
</VS_SHIP>
</CUSTOMER>
</COMPANY>
</COMPANIES>
</FREIGHT_XREF>
I have an XML document (snippet below) and I am trying to retrieve the FREIGHTFEE's attributes based on the value of multiple elements, as follows. Actually, for now I'm just trying to locate the elements that meet my criteria:
varCompany = 01 AND
varCustomer = *ALL AND
varShip = STD AND
varSTATE= IL
I have tried:
doc.Query("/FREIGHT_XREF/COMPANIES[COMPANY=varComa pny]/COMPANY[CUSTOMER=varCus tomer]/CUSTOMER[VS_SHIP=varShip]/COUNTRY[STATE=varState]")
and various permutations thereof, with no success. Where am I going wrong?
<FREIGHT_XREF >
<COMPANIES>
<COMPANY>
01
<CUSTOMER>
*ALL
<VS_SHIP>
STD
<COUNTRY>
USA
<STATE>
*ALL
<FREIGHTFEE UPSCode="UPN" TOD="PPA" Value="12.00" />
</STATE>
<STATE>
IL
<FREIGHTFEE UPSCode="UGC" TOD="PPA" Value="4.00" />
</STATE>
<STATE>
HI
<FREIGHTFEE UPSCode="UP2" TOD="PPA" Value="10.00" />
</STATE>
</COUNTRY>
</VS_SHIP>
</CUSTOMER>
</COMPANY>
</COMPANIES>
</FREIGHT_XREF>
Comment