Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
3 replies
Subscribers
7 subscribers
Views
1905 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Integrations
Is it possible to use mor complex xpath statements with the xpathdocument() func
moritzw
over 8 years ago
Is it possible to use mor complex xpath statements with the xpathdocument() function? For example something like:
xpathdocument(pv!xml_doc,"for $i in //ns:xyz/ns:abc/text() return if($i = 'Yes') then 'true' else 'false'")
I am getting an error when trying to execute the above statement.
OriginalPostID-214096
OriginalPostID-214096
Discussion posts and replies are publicly visible
Parents
0
sagarl511
A Score Level 2
over 8 years ago
@moritzw - If you use xpathdocument or xpathsnippet to search for element and if that element is not present it will return empty List of Text string. For e.g - if(rule!APN_isEmpty(xpathsnippet(
"
John
Doe
",
"//employees/employee/department/text()"
)),"Yes","No")
returns Yes as there is no department element whereas -
if(rule!APN_isEmpty(xpathsnippet(
"
John
Doe
",
"//employees/employee/name/text()"
)),"Yes","No")
returns No. May be this helps in solving your issue.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
sagarl511
A Score Level 2
over 8 years ago
@moritzw - If you use xpathdocument or xpathsnippet to search for element and if that element is not present it will return empty List of Text string. For e.g - if(rule!APN_isEmpty(xpathsnippet(
"
John
Doe
",
"//employees/employee/department/text()"
)),"Yes","No")
returns Yes as there is no department element whereas -
if(rule!APN_isEmpty(xpathsnippet(
"
John
Doe
",
"//employees/employee/name/text()"
)),"Yes","No")
returns No. May be this helps in solving your issue.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data