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

Can I output generated content between rows in a table (Styler v6.0)?

Highlighted
Newbie

Can I output generated content between rows in a table (Styler v6.0)?

Is it possible to output generated content between table rows or, more accurately, as gentext before a row that looks like it occurs between the rows.

I have a non-entry element that can occur before the first <entry> in <row>. The element has an attribute that, if present, needs to be output to look like a row (that spans the width of the table) that proceeds the current row. When I run some simple, mark-up only tests, I discover that content that is entered into the XML source between the rows is displayed, but content that is entered into a row, but outside of an entry, does not display. Using Styler, I've tried to output the content in the gentext on the <row> element, but have had no success whatsoever. I've tried looking at the FOSI source code, but I don't see a way of forcing this to appear in this context.

I'm using Styler v6.0 M080, and the stylesheet is FOSI-based. I have no authority to change the DTD, so I have to live the mark-up I'm given.

Here's some sample mark-up to show you the source. Confidential content has been changed.

<table>

    <tgroup align="left" char="" charoff="50" cols="3">

        <colspec colname="col1" colwidth="11*"/>

        <colspec colname="col2" colwidth="51*"/>

        <colspec colname="col3" colwidth="17*"/>

        <spanspec align="center" nameend="col3" namest="col1" spanname="whole"/>

        <thead valign="bottom">

            <row>

                <entry colname="col1" morerows="0" rotate="0" valign="top">

                    <para>ITEM #</para>

                </entry>

                <entry colname="col2" morerows="0" rotate="0" valign="top">

                    <para>DESCRIPTION</para>

                </entry>

                <entry colname="col3" morerows="0" rotate="0" valign="top">

                    <para>PART NUMBER</para>

                </entry>

            </row>

        </thead>

        <tbody valign="top">

            <row>

                <entry colname="col1" morerows="0" rotate="0" valign="top">

                    <para>Item 1</para>

                </entry>

                <entry colname="col2" morerows="0" rotate="0" valign="top">

                    <para>Description 1</para>

                </entry>

                <entry colname="col3" morerows="0" rotate="0" valign="top">

                    <para>Part Number 1</para>

                </entry>

            </row>

            <row>

                <special specialatt="Content to display in own row"></special>

                <entry colname="col1" morerows="0" rotate="0" valign="top">

                    <para>Item 2</para>

                </entry>

                <entry colname="col2" morerows="0" rotate="0" valign="top">

                    <para>Description 2</para>

                </entry>

                <entry colname="col3" morerows="0" rotate="0" valign="top">

                    <para>Part Number 3</para>

                </entry>

            </row>

        </tbody>

    </tgroup>

</table>

The element that I need to display as its own spanned row is on line 33 above. It has to be in the row because it is only applicable to that row. If the row is deleted or moved, the content needs to stay with it.

Here's how it needs to appear in the PDF output:

gentextBetweenRows.png

Am I asking to do the impossible without resorting to changing the XML mark-up?

Thanks for any help or insight you may have.

2 REPLIES 2
Highlighted

Re: Can I output generated content between rows in a table (Styler v6.0)?

Hi Tonua--

I feel your pain. I recently worked on a project where it would have been very useful to dynamically generate table rows via gentext. Alas, I was also unable to find a way to make it work. I believe the problem is Styler's tendency to insert wrapper elements around gentext content, which breaks the table machinery. For example, if you have a Styler rule for <special> that creates a gentext <row>, you don't just get the <row>, you get something like this:

<_sfe:gentext_before_or_after><_gte:Translate...><_gte:Target...><_dtd:row>Content to display in own row</_dtd:row></_gte:Target></_gte:Translate></_sfe:gentext_before_or_after>

I think the _sfe:* and _gte:* wrappers prevent the table rendering engine from recognizing your gentext as a table row.

I don't know what the solution is, though you might be able to work around it with source edits. Or, you might be able to add a transformation step to the publishing process to check for <special> elements in tables and convert them into proper table rows before passing the document on for publishing. In my case, I had a manageable number of permutations, so I just made a separate gentext condition that contained the entire table for each possibility. (As long as the extra wrapper elements are *outside* the table itself, the generated table renders OK.) But it seems like that approach wouldn't really be feasible for this use case.

If you do find a configuration that works, please share with the group! Good luck.

--Clay

Highlighted

Re: Can I output generated content between rows in a table (Styler v6.0)?

Thanks, Clay.

I suspected that was the case. And the fact that the <_sfe:gentext> element is output inside the row rather than actually before it just further complicates the issue.

I'm thinking that I'm going to have to do that transformation step that you recommended, but I'm holding out hope that a FOSI guru will come on and tell me that it can be done with source edits!

Thanks for your feedback.

Tonua

Announcements