xsl-list
[Top] [All Lists]

Re: [xsl] Need your recommendation please for an XPath expression

2016-07-19 07:08:25
On 19 July 2016 at 13:05, Costello, Roger L. costello(_at_)mitre(_dot_)org
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:
Hi Folks,

I need an XPath expression which returns a Boolean value:

        If there is an A then return true only if there is a B.
        If there is no A then return true.

For example, the XPath expression should return true for this:

<Document>
    <A/>
    <B/>
</Document>

The XPath should return false for this:

<Document>
    <A/>
</Document>

Which XPath expression is best (most efficient)?

(a)   if (A) then exists(B) else true()

(b)  (A and B) or (not(A))

(c)  something else (what?)


not(A) or B
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>