This is a follow up on my current work-around to this problem. Since it doesn't look like I have any control over the copying and pasting of the table headers, I thought I would try the following to bypass it.
As a work-around, I am attempting to copy the table header and put it at the top of each page with some acl code. I will then go back and remove the thead tags. So far I have copied it, made the text bold, and found the location to insert it into the document.
But when I try to insert it, it fails. I tried calling in_context(“entry”) to make sure that it was valid to put an entry tag at the place of insertion and it returned true. The entry tag is the first one in the string being inserted. I am setting the protect to none. But it still won’t insert. Is there some other setting that is stopping the insert? I also tried it with and without the current_doc() specified in the insert. Below is my code.
I am also interested in what you think of this approach.Would you do it this way or usefosi?
function copyTableHeaders( doc = -1 )
{
local oids[];
local header = '';
oid_find_children(oid_null(), oids, "thead|atipl::*", 0x08);
set protect=none; #Allow atipl tagsto bealtered
for(i in oids) {
local name = oid_name(oids[i]);
if ( name == "thead" )
{
…build the header string of text with the oid_content of the thead tag
} #end if thead
else if ( name == "atipl:startpage" && oid_name( oids[i+3] ) == "atipl:startrow")
{
goto_oid(oids[i+3]);
if (insert(header))
{
response("Successful insert!", "Ok", "Cancel");
}
else
{
response("Failed insert.", "Ok", "Cancel");
}
} #end if startpage
}
}
Thanks,
Alan