| Author |
selectNodes...combining?
|
|
| Bruce Duncan 2004-02-25, 7:29 pm |
| I have a simple XML file:
<cart>
<product prodid="12" itemid="30" flavorid="10">5</product>
<product prodid="12" itemid="30" flavorid="12">2</product>
<product prodid="14" itemid="38" flavorid="10">8</product>
</cart>
I wrote 2 separate search functions:
1) set nodefind = bagitems.selectnodes("product
[@itemid=""" & 30 & """]") returns 2
2) set nodefind = bagitems.selectnodes("product
[@flavorid=""" & 10 & """]") returns 2
My Question:
Can I combine the two and get a search result for
itemid=30 and flavorid=10? I only want the 1 record.
I'm using this in ASP. I appreciate any direction you
can give. Thanks.
-Bruce
| |
|
| Have you considered "and" operator?
selectnodes("product[@itemid='30' and @flavorid='10']")
--
Pohwan Han, Microsoft MVP, ASP/ASP.Net, Korea
Have a nice day.
"Bruce Duncan" <anonymous@discussions.microsoft.com> wrote in message
news:196d01c3fbf5$12701340$a301280a@phx.gbl...
> I have a simple XML file:
> <cart>
> <product prodid="12" itemid="30" flavorid="10">5</product>
> <product prodid="12" itemid="30" flavorid="12">2</product>
> <product prodid="14" itemid="38" flavorid="10">8</product>
> </cart>
>
> I wrote 2 separate search functions:
> 1) set nodefind = bagitems.selectnodes("product
> [@itemid=""" & 30 & """]") returns 2
> 2) set nodefind = bagitems.selectnodes("product
> [@flavorid=""" & 10 & """]") returns 2
>
> My Question:
> Can I combine the two and get a search result for
> itemid=30 and flavorid=10? I only want the 1 record.
>
> I'm using this in ASP. I appreciate any direction you
> can give. Thanks.
>
> -Bruce
|
|
|
|
| Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |