Jay Bryant wrote:
I followed Jay Bryant's advice and structured my xsl file according to
his example.  I got it to work well, but in saving things I overwrote
what I had done. I recreated it -- almost. I now have a few questions;

Glad it worked for you as far as it did.

Great.  You have been a tremendous help.


I have attached the xsl and xml tags.  They generate what I am now
asking about. Viewing the output at 100%:

1 - How do I fill the backgrounds of the cells of the third line (the
last header line).

Put the background-color attribute on the table-cell element rather than on the block element.

Did that.  It worked.  Thanks.


2 - How can I get the borders top join?  Look at the line between the
last header line and the first business unit header line.  Also, between
the other lines. the intent here is for the borders to be with 1pt of .5pt.

Borders are amazingly tricksy beasts. First off, to really get them to render correctly, you need to throw out the idea of border-collapse. Then you have two choices: Control each border (left, right, top, bottom) for each cell individually or set them all to the same values (width, color, and style). Thus, a simple way to get all the borders in a table to be 1pt wide is to set both the table's border and each cell's border to be .5pt wide. They'll all be adjacent when rendered, and you'll get 1pt borders. If you want something more complicated (some cells have borders while others don't or all the outside borders are double while the inners are solid), you should set each border (left, right, etc.) individually.

To that end, I've moved all your border attributes to table-cells, so that table and block no longer have border attributes.

When I moved them to the the table-cells, it looked great.


3 - Why doesn't the border show when cells are empty in the data area?

Actually, it did (I zoomed in to 400% to be sure. However, because the block in the cell had no content, the height of the block was 0, so you had a top border and a bottom border and nothing in between them. Consequently, the block rendered such that it looked like a thick line.

To fix this (and other issues), I removed the borders from blocks and put them on the cells. As a rule of thumb, define borders at the cell level and not at the block level. You should generally only put a border on a block if it's a stand-alone block (not in a table). There are exceptions, but, until you've strengthened your XSL-FO muscle some more, I suggest keeping things simple.

They show now when they are at the cell level.


4 - Why does it look like the vertical borders on the last line extend
beyond the bottom of the line?


I'm not seeing that, but I've seen it in other documents. If it's what I think it is, it's a rendering error in Acrobat Reader. Try zooming to different levels and seeing if the problem persists. If it does, you've got work to do. If not, it's a well-known (and much-loathed) quirk of Acrobat Reader.

It just occurred to me that you may mean "Why does the border stick out to the left and right relative to the cells that don't have borders. That's the nature of borders. The cell has its space, and the border has a space around the cell's space. So, if one cell has no border and the next cell down does have a border, the bordered cell appears to "stick out". Take a peek at http://www.w3.org/TR/2001/REC-xsl-20011015/slice4.html#area-intro to see what's happening. To fix those issues, either be consistent about your borders (everything has a border or everything doesn't), use just top and bottom borders, or set the border color of "borderless" cells to the cell's background color.

Also, fo:table doesn't have a line-height attribute, so I put that on the blocks.

It looks great now.


I have attached the modified XSLT file.

I am off to a movie, so I can't show you exactly how to control the borders individually right now. I hope these changes help you, though.

I hope you enjoyed the movie.  I still have a few minor questions.

1 - I am using number-columns-spanned in order to use the same template with sub-section headings and totals. I use the parameter <merge>. For the sub-titles, I give it a value of 13 (all the columns). For the sub-section totals, I give the first one a value of 5, followed by eight cells with a value of 1. It all worked, but I get one blank for the number of columns spanned and one blank for the background color. I isolated it to the following in the xml file:

<bu_line>
  <bu_item>
    <value>TRACKING SALES</value>
    <align>start</align>
    <borderline>solid .5pt</borderline>
    <fontweight>normal</fontweight>
    <fontsize>6pt</fontsize>
    <color>black</color>
    <merge>13</merge>
    <bg_color>#FFFF99</bg_color>
  </bu_item>
</bu_line>

If I remove that block, then there are no errors. In the xsl, it uses those keys for every line in the business bu_tiem section, with no additional errors. I'm stumped. It works, but it isn't "clean".

2 - How do I put spaces in place. For example, if I wanted " Admin", rather than "Admin", how do I make that happen? It seems to ignore initial whitespace.

3 - How do put in special characters like the ampersand?

As I progress through this, I pick up more and more ideas. For example, in the "shouda dun it that way" category is to use just the template for the data line. I could have run all the lines through that template without the need for specialized xsl stuff. Next time!

Thanks again for your tremendous help.




Jay Bryant


------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to