OSB : Xquery Comparision Failing Intermittently - xquery

I have following condition in my OSB proxy.
$body/*[1]/xyzflag eq 'true' and (:some other true conditions:)
The node xyzflag is not even present under node pointed by variable $body.
The condition works as expected (gives false) most of the times. but sometime it gives true.
Anyone has faced this situation? Seems a bug to me. Can some help?

The XQuery expression you are trying is wrong.
e.g. If your XML is looks like below:
<school>
<teacher>
<isClassteacher>Y</isClassteacher>
</teacher>
<teacher>
<isClassteacher>N</isClassteacher>
</teacher>
</school>
Then your expression will be like below:
data($body/teacher[1]/isClassteacher)='Y'
Note: Please make the changes as per your requirement.
Hope this will be helpful.
regards
Asutosh

Try to make it like this:
fn:data($body/[1]/xyzflag)

If you are checking for existence of that node <xyzflag>, I will suggest you to use fn:exists function.
This expression
$body/*[1]/xyzflag = 'true'
will return true if the node <xyzflag> is present. It is not going to bother whether the contents of the node is present or not

Related

How does one add constraints with Vapor?

How does one define constraints via Vapor? Here's my latest attempt:
database.schema(Thingmabob.schema)
.id()
.field("parentID", .uuid, .required, .references(Stuff.schema, .id))
.field("name", .string, .required)
.field("isDocumened", .bool, .required)
.field("value1", .uint, .required)
.field("value2", .uint)
.constraint(.custom("value2 > value1 + 1")) // << "syntax error"
.create()
Solution is two folds:
1) Seems the documentation — HA! — forgot to mention that any field mentionned in the .constraint(.custom( ... )) is set to lowercase. So if you have a field/column like .constraint(.custom("isDocumented ..."), the value in the constraint becomes isdocumented which fails to matches any column. Just beautiful!
2) Also, note that, while I'm using the .constraint() API, the framework has no idea what do to with it... I thus have to write the full statement CHECK notcamelcase > alsonotcamelcase (not just notcamelcase > alsonotcamelcase). Not sure why .constraint() isn't named .arbitrarySQLSegment() as that would've been more accurate and helpful than all that documentation I've read.

zsh array assignment and no match errors

zsh version 5.2
I'm attempting an array assignment using filename generation like so:
files=(/some/path/*/dir/myfile)
Indeed this is the way the zshoptions manual recommends to achieve what I want.
When no matches exist I want the array to be empty. Instead it's producing
no matches found: /some/path/*/dir/file
and the script terminates.
I've tried setting NULL_GLOB, CSH_NULL_GLOB and ensured NOMATCH is not set.
When matches do exist it works as expected.
Any help is appreciated.
Thank you in advance,
Wayne
Well of course I found the solution after posting my question.
For this to work EXTENDED_GLOB needs to be set as well as NULL_GLOB. Or a glob qualifier can be used so that NULL_GLOB only effects this particular expansion.
This is how to set NULL_GLOB for a single operation:
files=(/some/path/*/dir/myfile(N))
Hope that can help someone else who encounters this.
Wayne

Else condition in robot framework not running

I am trying run:
Run keyword if ${browser}='chrome' somekeyword
Else if ${browser}='ff' somekeyword
it's giving me a format error I am running as per doc. can anyone suggest the error?
Run Keyword If ${browser}=='chrome' keyword
... ELSE IF ${browser}=='ff' keyword
... ELSE keyword
Keep proper space either tab or 2+ spaces as this may also be the reason as suggested by #Bryan Oakley
Hope this helps if not do post the exact keywords you have used with the error...

what does mean the command if(0) in r?

I have a question, I have been reviewing some code and in one script, the authors use:
if(0){
#do something
}
Any help in what if(0) means?
The author (most likely) put the block of code in an if statement so that they could easily remove it if necessary without having to comment it out (or remove it). Similar to if(true) or if(false), you just need to change one value and it would skip that code.
Upon reviewing the code, developers should remove these kinds of statements once they've finalized all their source code not to confuse others.
Looks like something that will never be executed, since 0 = FALSE. Most probably this is a manual switch to test some code in parenthesis.

How to read a Gallio Report

I'm trying to read or redirect the test console output. I'm doing an AssertAreEqualIgnoringOrder and I need to parse some of the values within the failures. The failures output looks like this:
Expected elements to be equal but possibly in a different order.
Ensure the list of idols matches with the db
Equal Elements : ["98932", "670945", "6747749", "6770804", "7110604", "13280109", "13280121", "13280149", "14448042", "14448336", "15726213", "17009409", "17245584", "93123", "2212314", "10129661", "13280123", "13280125", "13280135", "13280144", "17245263", "18784003", "1112597", "2885514", "8505390", "13279857", "15032800", "17009391", "17009396", "17009398", "17880635", "18340462", "3606775", "13280116", "13280133", "13280137", "14448341", "15050039", "16711731", "17008920", "17009377", "17009381", "17009402", "17245606", "17901335", "865871", "6029748", "17009372", "17009386", "17009406", "17245604", "19113286", "19865372"]
Excess Elements : ["14419207"]
Missing Elements : ["17241620"]
How can I read this directly or redirect it to a file? If I can just parse the output, I can work it afterwards with some RegEx, that will not be a problem.
Another solution would be to parse the Gallio report file, but I'm sure there is a faster way.
Can you help me, please?
Thanks,
Andrei

Resources