I have a complication of the "usual" question of how to return a string value based on XPATH condition.
I've successfully used the following solutions before: Return a string value based on XPATH condition and Nested conditional if else statements in xpath
But now my XML is:
<Events xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<EventDetails>
<AccountingDate>2017-01-01</AccountingDate>
<PaymentDate>2017-01-31</PaymentDate>
</EventDetails>
<EventDetails>
<AccountingDate>2017-01-01</AccountingDate>
<PaymentDate xsi:nil="true"/>
</EventDetails>
</Events>
and I need to extract the PaymentDate if it has a value but otherwise substitute the AccountingDate i.e. 2017-01-31 for the first Event but 2017-01-01 for the second.
The problem is that the parser I'm forced to use is XPath 1.0 and does not recognize the nilled function and boolean(PaymentDate) is true if PaymentDate is nil.
I hope someone has a bright idea because I'm totally stumped.