thanks, it works
But unfortunately, it's quite slow.
So perhaps it's better to get all items and then ask for the parent and for the helpKey *).
*) not working yet ...
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "test",
Outline Box( "main", Life Distribution( Perspective( Compare Groups ), Y( :weight ), Grouping( :sex ), By( :age ) ) )
);
t0 = HP Time();
list1 = Current Report() << xpath( "//OutlineBox[@helpKey]" );
Show( (HP Time() - t0) / 1000000 );
t0 = HP Time();
list2 = Current Report() << xpath( "//ListBox//OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey])]" );
Show( (HP Time() - t0) / 1000000 );
t0 = HP Time();
firstResults = Current Report() << xpath( "//OutlineBox[@helpKey]" );
list3 = {};
For Each( {item, idx}, firstResults[{1, 2}],
found = Regex( (item << parent) << get xml(), "\A.*helpKey" ); //unfortunately not restricted to first line like should be !??!?!
If( Is Empty( item << parent ) | Is Missing( found ),
Insert Into( list3, item )
);
);
Show( (HP Time() - t0) / 1000000 );
(HP Time() - t0) / 1000000 = 0.048218; // no restriction
(HP Time() - t0) / 1000000 = 7.204071; // Xpath all-in-one
(HP Time() - t0) / 1000000 = 0.152291; // manual post-selection