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
1904 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
0
sagarl511
A Score Level 2
over 8 years ago
@moritzw - I have implemented this type of scenarios by fetching children data of given parent in xml in local variables and then using Appian looping functions on it based on requirements.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
moritzw
over 8 years ago
I have another case where an element is not present in some cases. Using the //ns:xyz/ns:abc syntax it only returns the existing elements. Is there a way for it to return a null value if the element doesn't exist?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
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