Ok, using XML similar to this...
Note that the 1st and 2nd <Opt> tags have the same range (Min & Max) but different type values...
Then the 3rd <Opt> tag has a different range, and 2 type values...
I was trying to select a single node by using this query...
"//opt[type = '" & Type & "'][Min <= " & Size & "][Max >= " & Size & "]"
(above code is used with VB, XML DOM, SelectSingleNode function)
If the Size = 1 or 2 and Type = A or B, such as:
"//opt[type = 'A'][Min <= 1][Max >= 1]"
"//opt[type = 'B'][Min <= 1][Max >= 1]"
It works fine...
The problem is due to the 2 <type> tags in the 3rd node...
If the Size = 3 to 5 and Type = A, such as:
"//opt[type = 'A'][Min <= 3][Max >= 3]"
It works fine, because it finds the A first, and returns true...
If the Size = 3 to 5 and Type = B, such as:
"//opt[type = 'B'][Min <= 3][Max >= 3]"
It Does Not work, because (again) it finds the A first, returns false, then terminates before finding the B in the second tag...
Does anyone know a way to force it to search all tags, instead of short ciruiting???
Thanks in Advance ;-)
-Josh
Visit My Site
PROGRAMMER:
Red-eyed, mumbling mammal capable of conversing with inanimate objects.
Code:
<Test>
<opt>
<name>Test1</name>
<Min>1</Min>
<Max>2</Max>
[b]<type>A</type>[/b]
</opt>
<opt>
<name>Test2</name>
<Min>1</Min>
<Max>2</Max>
[b]<type>B</type>[/b]
</opt>
<opt>
<name>Test3</name>
<Min>3</Min>
<Max>5</Max>
[b]<type>A</type>
<type>B</type>[/b]
</opt>
</Test>
Note that the 1st and 2nd <Opt> tags have the same range (Min & Max) but different type values...
Then the 3rd <Opt> tag has a different range, and 2 type values...
I was trying to select a single node by using this query...
"//opt[type = '" & Type & "'][Min <= " & Size & "][Max >= " & Size & "]"
(above code is used with VB, XML DOM, SelectSingleNode function)
If the Size = 1 or 2 and Type = A or B, such as:
"//opt[type = 'A'][Min <= 1][Max >= 1]"
"//opt[type = 'B'][Min <= 1][Max >= 1]"
It works fine...
The problem is due to the 2 <type> tags in the 3rd node...
If the Size = 3 to 5 and Type = A, such as:
"//opt[type = 'A'][Min <= 3][Max >= 3]"
It works fine, because it finds the A first, and returns true...
If the Size = 3 to 5 and Type = B, such as:
"//opt[type = 'B'][Min <= 3][Max >= 3]"
It Does Not work, because (again) it finds the A first, returns false, then terminates before finding the B in the second tag...
Does anyone know a way to force it to search all tags, instead of short ciruiting???
Thanks in Advance ;-)
-Josh
Visit My Site
PROGRAMMER: