Node Path query help


#1

I’m trying to write a query that finds all @start tags with value less than X, along with their children (following this guide, but not tagged @done. I thought this would do it, but it doesn’t return the right results:

((//@start <= "2014-08-10") union //@start//*) except //@done

I guess I’m getting messed up in the compound nature of it. Maybe someone could explain the rules for building up the conditions.


#2

A node path can be built by alternating axis steps (outline scope) with filter steps (matches):

all @start tags with value less than X

//@start <= "2014-08-10"

all descendants of them (but not the matches for @start <= "2014-08-10" themselves)

//@start <= "2014-08-10"//*

ALL their descendants AND themselves

//@start <= "2014-08-10"/descendant-or-self::*

descendants and selves which do NOT match @done

//@start <= "2014-08-10"/descendant-or-self::not @done

#3

PS If you paste that final nodePath whole into the JMK filter panel, I think you should find that it filters correctly, but there may be a current glitch in which the panel (which very ambitiously and impressively responds as we type), can choke on certain unfinished intermediate edits, and may give the impression that the match has not happened.


#4

Yeah, that works great in the filter panel. It doesn’t work in the txtquery.sh script, but we already discussed that in the other thread, so I wasn’t really expecting it to. Thanks for the explanation–that helps me understand the syntax.


#5

I’ve written a provisional @note property for txtquery.sh – I’ll send a copy for testing this evening.