TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
Shading table rows in FrameMaker when importing XML data
Subject:Shading table rows in FrameMaker when importing XML data From:Pspubs -at- aol -dot- com To:"TECHWR-L" <techwr-l -at- lists -dot- techwr-l -dot- com> Date:Tue, 15 Mar 2005 13:58:22 EST
Hello all,
I was asked tell how I solved the issue of automatically shading rows in
FrameMaker, so here it is. Thank you to those people who gave hints on how to get
started!
Here's the scenario: I'm importing XML data into FrameMaker. Most of the data
is within 350 tables, and the data is updated frequently. The tables have
subhead rows, which appear intermittantly and which must be shaded. It would take
much too long to shade all the subhead rows by hand, so they must be shaded
automatically. Here's how I did it. (If anyone else has a better way, please
let me know!)
These steps assume you know the basics of importing XML into FrameMaker, and
working with EDD files and FrameMaker paragraph formats. If you don't, I'd be
happy to explain -- just e-mail me (Becky Scott) at pspubs -at- aol -dot- com or
beckyrps -at- comcast -dot- net -dot-
The first step is to create a paragraph format with a Frame Below Pgf of a
filled bar. The filled bar, which is a graphic frame on the Reference Page,
should be about the height of the row you want to shade, and shaded as desired. To
keep the filled bar from being truncated by cell margins, in the Paragraph
Designer's Table Cell tab, change the Left and Right Cell Margins fields to -6
pt. (Later you may also want to change the Top and/or Bottom Cell Margins to -6
pt as well, but for ease of troubleshooting, don't do this at first.)
After this, you have a choice of methods: 1) use the paragraph format you
just created for the shaded text, and edit the text position using the FrameMaker
template in MIF format, or 2) use two paragraph formats to create the desired
effect. The MIF method is simpler but works only when the subhead text is
just one line. The second method is complicated but is more reliable.
MIF METHOD
Save the template as a MIF file and open it with a text editor. Change the
<FDY y%> value of the paragraph format to around 140%. Save the file, and update
the Application Definitions (structapps file) to define the template to be
the .MIF file you just created.
WARNING: This method doesn't work if there are multiple lines of text in
the cell, because it will only show the last line...the filled bar covers up
the other lines for some reason. Also, if you use FrameMaker to edit the
template later on, the FDY value in the MIF file will be deleted and you have to put
it back manually. So I didn't use this method.
TWO-FORMAT METHOD:
Give negative line spacing (about -12pts per row) to the paragraph format
with the filled bar, then call it something like "Bar". Then create another
paragraph format for the text itself (e.g., called "CellHeading").
Within each XML cell you want to shade, insert a container element ( e.g.
<Shading>) that contains two paragraph elements -- an empty element for the
paragraph with the filled bar, and after that, one containing the cell text.
(See the second row in the example below.)
EXAMPLE:
<Table COLS="2">
<TableBody>
<Row>
<Cell>nonshaded text column 1</Cell>
<Cell>nonshaded text column 2</Cell>
</Row>
<Row>
<Cell>
<Shading>
<p/>
<p>Text to be shaded column 1</p>
</Shading>
</Cell>
<Cell>
<Shading>
<p/>
<p>Text to be shaded column 2</p>
</Shading>
</Cell>
</Row>
...(more rows here)
</TableBody>
</Table>
Update the DTD, EDD, and RW files to add the <Shading> element and list
it as one of <Cell>'s children.
In the EDD file, set the attributes of the <Shading> container element so
that the first paragraph uses the 'Bar' format and the last paragraph uses
the 'CellHeading' format.
After importing the XML file, tinker with settings for Bar line spacing,
and the settings for space above and below the CellHeading paragraph. When the
display is as desired, import these paragraph settings into your template
file. Now you're set for the next time, if you ever have to import the XML data
again.
I know it's also possible to do shading by writing a VB script, but I didn't
have that expertise. If anyone does, I'm very anxious to talk to you!
I hope this is of use to someone! Thank you again to all who helped me!
--Becky Scott
PS Publications
(517) 485-2975
Lansing, Michigan
pspubs -at- aol -dot- com or beckyrps -at- comcast -dot- net
WEBWORKS FINALDRAFT - EDIT AND REVIEW, REDEFINED
Accelerate the document lifecycle with full online discussions and unique feedback-management capabilities. Unlimited, efficient reviews for Word
and FrameMaker authors. Live, online demo: http://www.webworks.com/techwr-l
Your Ad Here! Have a product or service you'd like to get some attention for? Use this space to get the word out! Contact lisa -at- techwr-l -dot- com for more details.
---
You are currently subscribed to techwr-l as:
archiver -at- techwr-l -dot- com
To unsubscribe send a blank email to leave-techwr-l-obscured -at- lists -dot- techwr-l -dot- com
Send administrative questions to lisa -at- techwr-l -dot- com -dot- Visit http://www.techwr-l.com/techwhirl/ for more resources and info.