xsl-list
[Top] [All Lists]

Re: [xsl] Find First Descendants That Match Predicate?

2018-12-28 14:00:36
Peter, in Eliot's example yes, but in the case as stated (arbitrary
wrappers), no. (I think we need *[title]//*[title] which is after all
a superset of *[title]/*[title].

It's the same as David's solution, refactored based on A[X but not Y]
being the same as A[X] but not A[Y]. But once we have done that, it
also simplifies, since in XPath, looking down twice is easier than
looking down and then up again.

I don't think it's backwards as long as we keep in mind how "the first
only" means "all, except those that are not first".

Best wishes and Happy 2019! Wendell

On Thu, Dec 27, 2018 at 12:17 PM Peter Flynn peter(_at_)silmaril(_dot_)ie
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

On 27/12/2018 15:15, Eliot Kimber ekimber(_at_)contrext(_dot_)com wrote:
That seems too easy (
[...]
On 12/25/18, 12:42 PM, "Wendell Piez wapiez(_at_)wendellpiez(_dot_)com" 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:
     How about

     .//*[title] except .//*[title]//*[title]

Shouldn't that be .//*[title] except .//*[title]/*[title]
to exclude those with immediate children with a title, rather than
excluding those which have any-depth descendants with a title?

P




-- 
Wendell Piez | wendell -dot- piez -at- nist -dot- gov |
http://www.wendellpiez.com
pellucidliterature.org | github.com/wendellpiez |
gitlab.coko.foundation/wendell  - pausepress.org
--~----------------------------------------------------------------
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>