cancel
Showing results for 
Search instead for 
Did you mean: 

Issue on using "or" in XPath

Former Member
0 Kudos

Hi All

I need to pass the multiple conditions dynamically to the conditional Action block.

My approach: 1st condition I have assigned to a local variable.I have used a for next loop.From 2nd condition I am using "Local variable or SomeExpression".

Now problem is always I am getting the ist value only.

e.g. suppose ist condition has returned as 0 and 2nd condition has returned as 1. So 0 or 1 should be 1 as output.But it is throwing as 0 only.

If in the XPath, I will do hard code value like number(0 or 1) , it is throwing the correct result.But when it is coming from query, then it is throwing wrong result.

i have tried to use "||" instead of "or", but still same issue is persisting.

Any idea why it is happening like this.

Thanks

Manisha

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Manisha,

Can you post the expression you are using. What are the expected results from the query? Can you brief more on this.

-Suresh

Former Member
0 Kudos

Hi

In the first assignment before for loop i am using the Xpath like this

Local.UpTimeCondition =

number(stringif( qry.Results{/Rowsets/Rowset/Row[#For_Next_Loop_1.CurrentItem#]/Status} ==

String_List_To_Xml_Parser_0.Output{/Rowsets/Rowset/Row[1]/Item},1,0

))

After for loop i am using second assignment like this

Local.UpTimeCondition=

number(Local.UpTimeCondition &"or "&stringif(qry.Results{/Rowsets/Rowset/Row[#For_Next_Loop_1.CurrentItem#]/Status} ==

String_List_To_Xml_Parser_0.Output{/Rowsets/Rowset/Row[#For_Next_Loop_2.CurrentItem#]/Item},1,0))

but it was throwing only first value output.

Thanks

Former Member
0 Kudos

Manisha,

Why Can't you use a conditional action blocks with two inputs of "AND" condition logic.Pass the query output in one input and xml output for second input.

-Suresh

Former Member
0 Kudos

Hi Suresh

In our case no of conditional inputs are not fixed.It is dynamic.So we can not use Conditional Action block.

Former Member
0 Kudos

After for loop i am using second assignment like this

Local.UpTimeCondition=

number(Local.UpTimeCondition &"or "&stringif(qry.Results{/Rowsets/Rowset/RowFor_Next_Loop_1.CurrentItem#/Status} ==

String_List_To_Xml_Parser_0.Output{/Rowsets/Rowset/RowFor_Next_Loop_2.CurrentItem#/Item},1,0))

from above expression

Suppose

Local.UpTimeCondition=1 and

stringif(qry.Results{/Rowsets/Rowset/RowFor_Next_Loop_1.CurrentItem#/Status} ==

String_List_To_Xml_Parser_0.Output{/Rowsets/Rowset/RowFor_Next_Loop_2.CurrentItem#/Item},1,0) =0

and if your desired output is 1or0 then your expression should be

Local.UpTimeCondition=

(Local.UpTimeCondition &"or "&stringif(qry.Results{/Rowsets/Rowset/RowFor_Next_Loop_1.CurrentItem#/Status} ==

String_List_To_Xml_Parser_0.Output{/Rowsets/Rowset/RowFor_Next_Loop_2.CurrentItem#/Item},1,0))

that is what i understand

but if you want output as 1 Logical OR 0 then your expression should be

Local.UpTimeCondition=

(Local.UpTimeCondition || number(stringif(qry.Results{/Rowsets/Rowset/RowFor_Next_Loop_1.CurrentItem#/Status} ==

String_List_To_Xml_Parser_0.Output{/Rowsets/Rowset/RowFor_Next_Loop_2.CurrentItem#/Item},1,0))).

Former Member
0 Kudos

Manisha,

What version of MII are you using? Can you also post the expression so we can investigate it?

Thanks,

Kevin