Is it possible to use mor complex xpath statements with the xpathdocument() func

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
  • @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(

    "JohnDoe",
    "//employees/employee/department/text()"
    )),"Yes","No")

    returns Yes as there is no department element whereas -

    if(rule!APN_isEmpty(xpathsnippet(

    "JohnDoe",
    "//employees/employee/name/text()"
    )),"Yes","No")

    returns No. May be this helps in solving your issue.
Reply
  • @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(

    "JohnDoe",
    "//employees/employee/department/text()"
    )),"Yes","No")

    returns Yes as there is no department element whereas -

    if(rule!APN_isEmpty(xpathsnippet(

    "JohnDoe",
    "//employees/employee/name/text()"
    )),"Yes","No")

    returns No. May be this helps in solving your issue.
Children
No Data