Forum Discussion
Department_of_T
11 years agoContributor
I think i had the code in the wrong place. Now i have placed the code in the top part 'XPATH EXPRESSION' and it works when the JDBC result is NOT null. How can i ensure the assert does not throw an error message when the value of the JDBC is null ''
I tried this but it didnt work.
concat(//${FindPersonCurrentVehOwner - JDBC#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]/SUBSEQUENT_GIVEN_NAMES[1]},"")
ERROR MESSAGE WHEN RESULT FROM JDBC IS NULL
XPathContains assertion failed for path [declare namespace ns0='http://transport.wa.gov.au/apo-ws/'; not(exists(//ns0:findVehicleRegistrationRenewalResponse[1]/findVehicleRegistrationRenewalResponse[1]/subsequentGivenNames[1]/text()) ) or (exists(//ns0:findVehicleRegistrationRenewalResponse[1]/findVehicleRegistrationRenewalResponse[1]/subsequentGivenNames[1]) and contains(//ns0:findVehicleRegistrationRenewalResponse[1]/findVehicleRegistrationRenewalResponse[1]/subsequentGivenNames[1]/text(),${FindPersonCurrentVehOwner - JDBC#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]/SUBSEQUENT_GIVEN_NAMES[1]} ))] : RuntimeException:net.sf.saxon.trans.XPathException: XPath syntax error at char 131 on line 5 in {...bsequentGivenNames[1]/text(...}: Node constructor expressions are allowed only in XQuery, not in XPath
I tried this but it didnt work.
concat(//${FindPersonCurrentVehOwner - JDBC#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]/SUBSEQUENT_GIVEN_NAMES[1]},"")
declare namespace ns0='http://transport.wa.gov.au/apo-ws/';
not(exists(//ns0:findVehicleRegistrationRenewalResponse[1]/findVehicleRegistrationRenewalResponse[1]/subsequentGivenNames[1]/text()) )
or
(exists(//ns0:findVehicleRegistrationRenewalResponse[1]/findVehicleRegistrationRenewalResponse[1]/subsequentGivenNames[1]) and
contains(//ns0:findVehicleRegistrationRenewalResponse[1]/findVehicleRegistrationRenewalResponse[1]/subsequentGivenNames[1]/text(),${FindPersonCurrentVehOwner - JDBC#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]/SUBSEQUENT_GIVEN_NAMES[1]}))
ERROR MESSAGE WHEN RESULT FROM JDBC IS NULL
XPathContains assertion failed for path [declare namespace ns0='http://transport.wa.gov.au/apo-ws/'; not(exists(//ns0:findVehicleRegistrationRenewalResponse[1]/findVehicleRegistrationRenewalResponse[1]/subsequentGivenNames[1]/text()) ) or (exists(//ns0:findVehicleRegistrationRenewalResponse[1]/findVehicleRegistrationRenewalResponse[1]/subsequentGivenNames[1]) and contains(//ns0:findVehicleRegistrationRenewalResponse[1]/findVehicleRegistrationRenewalResponse[1]/subsequentGivenNames[1]/text(),${FindPersonCurrentVehOwner - JDBC#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]/SUBSEQUENT_GIVEN_NAMES[1]} ))] : RuntimeException:net.sf.saxon.trans.XPathException: XPath syntax error at char 131 on line 5 in {...bsequentGivenNames[1]/text(...}: Node constructor expressions are allowed only in XQuery, not in XPath
Related Content
- 7 years ago
Recent Discussions
- 3 days ago