xsl-list
[Top] [All Lists]

Re: [xsl] XPath expression to express: There must be an empty sequence

2017-11-19 12:49:28
sequence[not(item)]

Assume that the root element, <sequences>, is the context node.

Is that the right way to express the rule?


It's Ok, arguably sequence[empty(item)] is more direct (as it relies
less on the implicit boolean value of a list of items) but it's same
thing really (I tend to use not() as empty() is a newfangled xpath2
addition)

every $element in $set//element satisfies exists(sequence[(item =
$element) and not(item[2])])

looks OK to me, an alternative might be

not($set/element[not(.=current()/sequence[not(item[2])]/item)])

which is also xslt1 1 again as it happens.

David
--~----------------------------------------------------------------
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>