Question

I have an InfoPath 2007 form that uses selectNodes to chose a collection of items from my web service. So I have

<customer>
  <City>
  <State>
</customer>

In my code I have something like

customerData.selectNodes("tns:customer");

Of course this gives me all customers. But what if I want to filter out customers that live in a particular state? How can I modify my approach if I wanted to exclude all values of "FL" in the state?

Was it helpful?

Solution

Something like:

 customerData.selectNodes("tns:customer[not(State = 'FL')]");

Note that if "FL" comes from some other string you may need to perform escaping ( Special Character in XPATH Query ).

I'd recommend reading on XPath, i.e. here are some samples to get you started.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top