Hi, I got this xml file and I need to check if all the time is set to 0800. If all of the time is set to 0800, then Audit passed. But if there is other than 0800 the script would say Audit Failed.
Audit Passed
Audit Failed - Tiger02, Tiger04
Audit Failed - sample.xml not found
=================================================
Sample.xml
=================================================
Currently what I have is this
Q: if exist file “C:\sample.xml” then ((node value of attribute “Node” of it as string & " - " & node value of attribute “Time” of it as string) of selects “Sample/Test” of xml document of file “C:\sample.xml”) else “Audit Failed, sample.xml not Found”
You are pretty close, but getting the output exactly the way you want it is a little bit tricky…
Here is the basics of what you want to do:
node values of attributes “Node” of selects “/Sample/Test/Info” whose (exists node values whose (it != “0800”) of attributes “Time” of it) of xml document of file “C:\sample.xml”
Notice that the “whose” clause will filter out the values that are “0800”.
Here is what I came up with that includes the formatting you want:
q: if (exist file “C:\sample.xml”) then ((if (it = “”) then “Audit Passed” else "Audit Failed - " & it) of (concatenation ", " of (node values of attributes “Node” of it) of selects “/Sample/Test/Info” whose (exists node values whose (it != “0800”) of attributes “Time” of it) of xml document of file “C:\sample.xml”) ) else "Audit Failed, sample.xml not Found"
A: Audit Failed - Tiger02, Tiger04