Skip to main content
18-Opal
March 9, 2012
Question

FOSI comparison

  • March 9, 2012
  • 3 replies
  • 907 views
There may be a more direct FOSI-ish way to do it, but as a last resort,
I would assume you could do it using an ACL SYSTEM_FUNC, something along
these lines:



<att>

<specval attname="fosicompare" attloc="SYSTEM-FUNC&lt;br"/><">http://localhost:62953/aeFosi/help1325.html?queryId=135f845da96> "

attval="#NONE">

<charsubset>

<usetext source="\This" element=" has=" no=" content\&quot;=">

</usetext>

</charsubset>

</att>



in doctype.acl:



function fosicompare(window, oid) {

# compare A.txt and B.txt, return 1 if they are equal

return (fosivar_value(window, "A.txt", oid)==fosivar_value(window,
"B.txt", oid));

}



--Clay





Clay Helberg

Senior Consultant

TerraXML


    3 replies

    1-Visitor
    March 9, 2012
    FWIW you can also call attname="packagename::functionname" if you load that
    package on PE, say from editinit. In either case, you can also return
    values from the function you are calling, so you might have something like:

    <specval attname="packagename::functionname" attloc="system-func"&lt;br"/>attval="no">
    <specval attname="packagename::functionname" attloc="system-func"&lt;br"/>attval="yes">

    I don't have any that test against numbers, but presumably you could do
    that if you wanted to.

    Take care with system-func calls, however. It is possible to consume a lot
    of CPU. I don't remember the "math," but if a system-func is called too
    often, or recursively, or some such, you can bring PE to its knees.

    For this reason alone, I agree with Clay's categorization of these as a
    "last resort."


    1-Visitor
    March 9, 2012
    You are so right -- certain system-funcs or too many system-funcs can slow formatting to a crawl or worse. That's why I strongly recommend using system-func only as a last resort, even though it may be very tempting to use ACL as a shortcut for FOSI coding. One of the reasons FOSI formatting is fast is because charlist coding is compiled. However, attribute processing must be handled in real-time for each document.

    An ACL pre-print process, on the other hand, can be quite fast, and may provide a good alternative to system-func.

    Suzanne


    1-Visitor
    March 12, 2012
    Note that in this example, there are two e-i-cs: one with the enumerate and savetext categories and another with the #FOSI test.#FOSI does not work in the same e-i-c with the enumerat and savetext categories. The workaround is to put the #FOSI test in a pseudo-element.

    Suzanne