Re: [xsl] Seek an XPath 2.0 expression that handles an empty text field, regardless of how it's represented in XML

Subject: Re: [xsl] Seek an XPath 2.0 expression that handles an empty text field, regardless of how it's represented in XML
From: "G. Ken Holman g.ken.holman@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 22 Sep 2016 16:01:30 -0000
At 2016-09-22 15:55 +0000, Costello, Roger L. costello@xxxxxxxxx wrote:
I want an XPath 2.0 expression that outputs "do action" if the B field is empty, regardless of which of the two XML representations is used. This XPath expression seems to work:

if (not(B) or B eq '') then "do action" else "no action"

This gives you the same result:


if (not(string(B))) then "do action" else "no action"

I hope this helps.

. . . . . . . Ken


-- Check our site for free XML, XSLT, XSL-FO and UBL developer resources | Streaming hands-on XSLT/XPath 2 training @US$45: http://goo.gl/Dd9qBK | Crane Softwrights Ltd. _ _ _ _ _ _ http://www.CraneSoftwrights.com/s/ | G Ken Holman _ _ _ _ _ _ _ _ _ _ mailto:gkholman@xxxxxxxxxxxxxxxxxxxx | Google+ blog _ _ _ _ _ http://plus.google.com/+GKenHolman-Crane/posts | Legal business disclaimers: _ _ http://www.CraneSoftwrights.com/legal |

Current Thread