Hi,
This is actually how XPath works, and is the expected behavior. A little counter-intuitive I agree, but correct nontheless. Anyway, I'm certainly no XPath expert, so this might be a convoluted way of getting the information you're after, but at least it works:
content = null
if( context.expand( '${DataSource - Get MessageLog XML - NextAceRequestMessageLogger#MSGLOG_MESSAGE#declare namespace re_1=\'urn://esb.fnf.com/ESBOrderGateway/NextAceTranslatorResult\'; exists(//body[1]/re_1:receive[1]/result[1]/PROPERTY[1]/COUNTY[1])}' ) == 'true' ) {
//Element exists!
if( context.expand( '${DataSource - Get MessageLog XML - NextAceRequestMessageLogger#MSGLOG_MESSAGE#declare namespace re_1=\'urn://esb.fnf.com/ESBOrderGateway/NextAceTranslatorResult\'; string-length(//body[1]/re_1:receive[1]/result[1]/PROPERTY[1]/COUNTY[1]) = 0}' ) ) {
//Element is empty!
content = ""
} else {
//Element has content!
content = context.expand( '${DataSource - Get MessageLog XML - NextAceRequestMessageLogger#MSGLOG_MESSAGE#declare namespace re_1=\'urn://esb.fnf.com/ESBOrderGateway/NextAceTranslatorResult\'; //body[1]/re_1:receive[1]/result[1]/PROPERTY[1]/COUNTY[1]}' )
}
}
log.info content
Regards,
Dain
SmartBear Software