cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

savetext/usetext not respecting/eating nestedtouchup PIs

GarethOakes
16-Pearl

savetext/usetext not respecting/eating nestedtouchup PIs

This makes sense. It’s impossible for PIs to form a structure for
contexts – PIs are single "tags" in the markup and do not form a
structure. Unlike an element which always has start and end tags. Just
because a PI has "/touchup" in the name doesn’t mean that it forms
part of the markup structure...

With ACL you are working with OIDs (document nodes) rather than just
the document elements (which is what FOSI looks at -
ELEMENT-in-context).

An alternative approach if you did need structure would be to use a
separate namespace to overlay real markup tags for touchup on top of
your regular document markup.

None of this helps you at all right now, but just thought it might be
a useful thing to realise when thinking about these type of issues.

Cheers,
Gareth

Quoting Paul Nagai <->:

> For some reason e-i-c's for PIs (at least the touchup PI) do not know about
> context of another touchup PI. I'm not sure if it is the first touchup can't
> know it's ancestors or whether it's not possible for any element to know
> it's in a touchup (there is a distinction there, but I'm not positive I've
> 'splained it English-like). One of them fails. In other words, gi="touchup"
> context="* touchup" fails even when that is, in fact, the actual context.
>
> My e-i-c actually relies on an attribute test that runs a system-func that
> reports whether or not touchup has an ancestor touchup. Why the ACL can
> figure it out but FOSI can't, I don't know. Anyhow, this works, as I've
> said, everywhere (we've tested) except the semantic table.
>
> Thanks, Trudy and Jean, for taking some time to think on this.
>
> I'll be sure and let everyone know what support and I eventually find ...
>
>
2 REPLIES 2

Of course you're right. That totally explains why the e-i-c context="*
touchup" fails.

It still doesn't explain, or if it did, I didn't get it, why the FOSI +
system-func works inside of regular tables but not in semantic tables. And,
probably, the real question has nothing to do with any sort of table (but I
haven't tested this variation yet), but is why does savetext/usetexting
nested touchups fail the FOSI + system-func?

>
> My e-i-c actually relies on an attribute test that runs a system-func that
> reports whether or not touchup has an ancestor touchup. Why the ACL can
> figure it out but FOSI can't, I don't know. Anyhow, this works, as I've
> said, everywhere (we've tested) except the semantic table.


Turns out this is the bit that was failing. Support caught me trying to use
an oid_xpath_xxxx function in my system-func ACL in contexts that sometimes
included gentext ... my semantic tables ... which is not supported. There is
now an SPR for documentation to explicitly state this limitation. They
kindly rewrote my test from (retyped by hand so careful if you're
copy/pasting) this:
local exists = "no";
if (oid_xpath_boolean($oid, 'ancestor::_touchup')) {
exists = "yes";
}
return exists;

To this:
local exists = "no";
for (oid = oid_parent(oid); oid_valid(oid); oid = oid_parent(oid)) {
if (oid_name(oid) =="_touchup") {
exists = "yes";
}
}
return exists;
Top Tags