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

modify table header before repeating at page break

alans
1-Newbie

modify table header before repeating at page break

I am using Arbortext 5.2 with an E3 server.

When I want to do a print preview of an xml document, it goes through two phases of composing it. First it adds atipl tags and line numbers (as generated text in attr1 characteristic of the atipl:startline tags). These changes are displayed in the editor. Then it composes it for pdf and the results are displayed in the print preview window. During the second compose, it takes the table headers (everything within the thead tag) and inserts them at the top of each page when the table goes across a page break.

The problem is that the line numbers in the table headings are copied over and inserted at the top of each page. The line numbering is correct until this happens. I believe that copying the table headers is part of the stylesheet or fosi but I don't know where it determines that it needs to copy and insert them. Also, can I modify the copied header before it gets inserted?

8 REPLIES 8

Alan,



The table headers found at the top of each page are part of a <float>. This
should be in your <charsubset> or <charlist>. It will probably be in an
<att> like this



<att>
<specval attname="print-only" attloc="system-var" attval="#ANY">
<charsubset>
<usetext source="title.psd.txt"></usetext>
<usetext source="title.psd.txt,\–Continued\">
<subchars charsubsetref="titlesub">
<float flidref="tbltitlcontd" width="page" scope="ts-category"&lt;br"/>pagetype="next"></subchars>
</usetext>
</charsubset>
</att>



The 'flidref' is set in the <floatloc>'s 'floatid' in your <rsrcdesc>. Then
it is called by the 'topfloat' or 'botfloat' in the <flowtext> of the
various pagesets.



Now I have not had a need to use the line numbers, so this is a weak area
for me. But what I suspect is in the second <usetext> in my example, you
will need to increment the line counter for the header.



You can also find a good bit of info on how floats work in the 28001
tutorial that is part of the epic distributed stuff. Find the tutorials
folder open the 28001C folder and then open the 28001c.sgm file.



Lynn


alans
1-Newbie
(To:alans)

Thanks so much for your reply Lynn! I think I found something that matches part of what you told me.

In the flowtext section of the pageset, is the following with repeat_titles being referenced by the topfloat:

<flowtext numcols="1" balance="0"> <column width="6.50in" vjprior="comp" topfloat="repeat_titles" botfloat="repeat_titles_bottom"/>

""" "Like you said, the repeat_titles is defined in the rsrcdesc section above, <floatloc floatid="repeat_titles" floattyp="atcolbrk" minspace="12pt" nomspace="18pt" maxspace="20pt"/>

But I can't find where repeat_titles is set with a float flidref or subchars in any of the att or charlist sections in the fosi document. Is it possible that repeat_titles is a standard float used and set by the publishing engine?

Thanks,

Alan

If you have one or more rows set as header rows they automatically
repeat without FOSI intervention.

-Andy
\ / Andy Esslinger F-22 Tech Order Data
_____-/\-_____ (817) 777 3047 LM Aero Box 748
\_\/_/ Fort Worth, TX 76101


alans
1-Newbie
(To:alans)

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

Alan,

I have not tested your code, but just reading through it I am wondering if you are actually completeing the function.

You have an 'if/else" statement so one or the other will be evaluated, but not both. 

What I think you need to do is find the <thead>, capture the text and then find the next page break while inside a table to place your data. 

While the oid_find_children() seems to work, it might be easier to do this with a while(oid_valid()) function.  Set 'o' as oid_first(), then while(oid_valid(o)) check each oid_name(o) for thead or ati page.  Advance 'o' with o=oid_forward(o). 

Just my two cents using my tried and true shoot from the hip, don't try or test anything approach.  😄

Lynn


---- Alan Sommercorn <alans@resdat.com> wrote:
> 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 use fosi?
> function copyTableHeaders( doc = -1 )
> {                      
>    local oids[];
>    local header = '';
>    oid_find_children(oid_null(), oids, "thead|atipl::*", 0x08);
>    set protect=none; #Allow atipl tags to be altered
>                        
>    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
>
>      
> ----------     
alans
1-Newbie
(To:alans)

Thanks for the oid functions, Lynn! Do you have any comments on why my insert is failing?
dugald
1-Newbie
(To:alans)

I have to confess that I don't know anything about the atipl namespace; is the atipl::startrow tag an empty element? If it is an empty element, then your goto_oid(oids[i+3]) will take you to a spot directly after its tag, but if the atipl::startrow element can contain other elements or text then your goto_oid command will take you inside the start tag. This would cause your insert function to fail because it's trying to insert your markup inside the atipl::startrow tag. To get around this problem, you would want to use:
goto_oid(oids[i+3],-1); # to place the insertion point before the end tag
forward_char(1); # to move directly after the end tag
and then call insert().

If atipl::startrow is an empty tag, then that's obviously not the problem. Are you seeing your "Failed insert." dialog? Or does it never show up at all? Have you tried:
eval $header
to see that the string you're trying to paste is the one you expect? If so, then have you tried the in_context function to test to see if you can legally insert the text in the $header variable?

Cheers,

Dugald

Alan

Off the top of my head, no I don't.  What I'd do is ignore the thead search and just make a test header with some obscure text, like "I am great".  Then run the script to only look for the atipage command.  I'd even put a debug in there to let me know I found it. 

Then see if the insert works.  Right now I am not sure if both if your if else statements are being processed.  So narrow the field down.  Get the insert working, then expand to capture the header.

Lynn

---- Alan Sommercorn <alans@resdat.com> wrote:
> Thanks for the oid functions, Lynn!  Do you have any comments on why my insert is failing?
>      
> ----------     
Announcements