login about faq

Hi all,

I would like to ask if there is possible for multiple conditions search by the method of SearchForAttribute. (in Chilkat v9.5.0)

After reading the example, I found that there is only one condition for the search such as

' Search for all "fruit" nodes having a color attribute ' where the name of the color ends in "e"; xFound = xSearchRoot.SearchForAttribute(xBeginAfter,"fruit","color","*e")

Here is my sample code:

<Tables>
  <Table code="101" section="1" status="0" />
  <Table code="102" section="1" status="1" />
  <Table code="201" section="2" status="0" />
  <Table code="202" section="2" status="0" />
  <Table code="301" section="3" status="1" />
  <Table code="302" section="3" status="1" />
</Tables>

I would like to search the table for both conditions of "section in (1,2) AND status=1"

Thanks to advise.

asked Jul 27 '17 at 05:11

Siupo's gravatar image

Siupo
11


It appears you'll need to use the SearchForAttribute twice. Once on the original object, then once on the object returned from the first search.

link

answered Jul 27 '17 at 11:44

TracyP's gravatar image

TracyP
1213

I would recommend iterating over the direct children of the "Tables" element and then checking the attribute values of each.

link

answered Aug 09 '17 at 12:02

chilkat's gravatar image

chilkat ♦♦
12.8k325457617

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×65
×2

Asked: Jul 27 '17 at 05:11

Seen: 1,254 times

Last updated: Aug 09 '17 at 12:02

powered by OSQA