I can't provide any information about the relative cost, performance-wise,
of those three methods. I do not think #2 is one of the soul-crushing
performance hounds that will bring your server to its knees. Especially if
the element being tested is not extremely common, Because #2 is looking at
the element already in memory, it should not be "bad". It's when you start
doing things like \para\@attr where the entire tree is examined every time
that you can get in trouble.
FYI: I do not think #3 will do what you want. I think isEmpty.txt will
always satisfy #ANY whether or not there is content in the element because
isEmpty.txt will always be instantiated (which is what #ANY tests) even if
it is in fact empty. You could write an ACL that evaluated the
non-white-space beginning/ending string length and returned 0 for zero
length and 1 for anything else and call it from a sys-func. Again, though,
I'm not sure how that would compare to #2 performance-wise.
<specval attname="packagename::aclname" attloc="system-func" attval="0">
Or
<specval attname="packagename::aclname" attloc="system-func" attval="1">
where your ACL file looks like this (typed by hand, so test/debug before
you use it):
####
package packagename
function aclname(win,oid) {
local exists = 0
if (length(trim($oid)) > 0 {
exists = 1
} # end if
return $exists
} # end aclname
####
On Tue, May 20, 2014 at 9:39 AM, Caroline Leccese <
-> wrote:
> I'm testing for presence of any content in a tag and I'm wondering which
> is the least expensive, or if there is a better way (I'm using #2)
>
> 1. <specval<br/>> attname="_styleexportfosi::sysfunc_content_test('','#any','atAnyLevel','includes')"
> attloc="system-func" attval="1"/>
>
> 2. <specval attname="self::*[normalize-space(.)!="]" attloc="#xpath"<br"/>> attval="1"/>
>
> 3. <savetext textid="isEmpty.txt" conrule="#CONTENT"/">
> <specval attname="isEmpty.txt" attloc="#FOSI" attval="#ANY"/>
>
> Thanks!
>