You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Sheldon Glickler <sh...@thevillages.net> on 2008/10/19 14:00:43 UTC

Once again I need a little more help please.

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;

1 - In the attached files, why are no business units showing up?  I have 
looked and looked but can't figure out why they don't.

2 - How do I get the background color to fill the entire cell and not 
just the text background.  (When I had the business units data showing 
up, the header cell backgrounds filled the entire space).

3 - When the business data did appear earlier, and I viewed at 100%, the 
borders did not run into each other and left a small space between them. 
  How do I force the borders to join?

Thanks for any help.

Re: NullPointerException in XSL-FO ?

Posted by csanders <cs...@hoovers.com>.
Well it turned out on large documents, the first byte does not get 
written to the document stream fast enough,  and the browser has a built 
in 60 second timeout for links.  This was causing a break in the 
connection, in case anyone else experiences this.

csanders wrote:
> I'm streaming an XSL-FO generated PDF to the user by passing tomcat's 
> OutputStream to the XSL-FO generator and am getting this error ( below 
> )  when the PDF's get a little on the large side , anyone seen this 
> behavior before ?
>
>
>
>
>
> java.lang.NullPointerException
>        at 
> org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:747) 
>
>        at 
> org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:432)
>        at 
> org.apache.coyote.http11.InternalOutputBuffer.flush(InternalOutputBuffer.java:305) 
>
>        at 
> org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:992)
>        at org.apache.coyote.Response.action(Response.java:183)
>        at 
> org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:322)
>        at 
> org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:293)
>        at 
> org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:98) 
>
>        at 
> org.apache.commons.io.output.ProxyOutputStream.flush(ProxyOutputStream.java:61) 
>
>        at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:278)
>        at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:122)
>        at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:212)
>        at java.io.BufferedWriter.flush(BufferedWriter.java:236)
>        at 
> org.apache.fop.pdf.AbstractPDFStream.output(AbstractPDFStream.java:197)
>        at org.apache.fop.pdf.PDFStream.output(PDFStream.java:120)
>        at org.apache.fop.pdf.PDFDocument.output(PDFDocument.java:937)
>        at 
> org.apache.fop.render.pdf.PDFRenderer.renderPage(PDFRenderer.java:810)
>        at 
> org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:113)
>        at 
> org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:312) 
>
>        at 
> org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:167) 
>
>        at 
> org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.makeNewPage(AbstractPageSequenceLayoutManager.java:284) 
>
>        at 
> org.apache.fop.layoutmgr.PageBreaker.handleBreakTrait(PageBreaker.java:494) 
>
>        at 
> org.apache.fop.layoutmgr.PageBreaker.startPart(PageBreaker.java:398)
>        at 
> org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:421) 
>
>        at 
> org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:371) 
>
>        at 
> org.apache.fop.layoutmgr.PageBreaker.doPhase3(PageBreaker.java:262)
>        at 
> org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:346) 
>
>        at 
> org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:264) 
>
>        at 
> org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:106) 
>
>        at 
> org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:234) 
>
>        at 
> org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:123) 
>
>        at 
> org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:340) 
>
>        at 
> org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:169)
>        at 
> org.apache.xml.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.java:261) 
>
>        at 
> org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1399) 
>
>        at 
> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411) 
>
>        at 
> org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374) 
>
>        at 
> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411) 
>
>        at 
> org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2281) 
>
>        at 
> org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1367) 
>
>        at 
> org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:709) 
>
>        at 
> org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1284) 
>
>        at 
> org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1262) 
>
>        at 
> com.dnb.components.download.ReportGenerator.generatePDF(Unknown Source)
>        at 
> com.dnb.components.download.controllers.StreamDownloadController.execute(Unknown 
> Source)
>        at 
> com.dnb.components.web.velocity.VelocityRunner.run(VelocityRunner.java:67) 
>
>        at 
> com.dnb.components.web.velocity.VelocityRunner.call(VelocityRunner.java:89) 
>
>        at 
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>        at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) 
>
>        at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) 
>
>        at java.lang.Thread.run(Thread.java:619)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>


-- 

Thanks,
Charlie


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


NullPointerException in XSL-FO ?

Posted by csanders <cs...@hoovers.com>.
I'm streaming an XSL-FO generated PDF to the user by passing tomcat's 
OutputStream to the XSL-FO generator and am getting this error ( below 
)  when the PDF's get a little on the large side , anyone seen this 
behavior before ?





java.lang.NullPointerException
        at 
org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:747)
        at 
org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:432)
        at 
org.apache.coyote.http11.InternalOutputBuffer.flush(InternalOutputBuffer.java:305)
        at 
org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:992)
        at org.apache.coyote.Response.action(Response.java:183)
        at 
org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:322)
        at 
org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:293)
        at 
org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:98)
        at 
org.apache.commons.io.output.ProxyOutputStream.flush(ProxyOutputStream.java:61)
        at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:278)
        at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:122)
        at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:212)
        at java.io.BufferedWriter.flush(BufferedWriter.java:236)
        at 
org.apache.fop.pdf.AbstractPDFStream.output(AbstractPDFStream.java:197)
        at org.apache.fop.pdf.PDFStream.output(PDFStream.java:120)
        at org.apache.fop.pdf.PDFDocument.output(PDFDocument.java:937)
        at 
org.apache.fop.render.pdf.PDFRenderer.renderPage(PDFRenderer.java:810)
        at 
org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:113)
        at 
org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:312)
        at 
org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:167)
        at 
org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.makeNewPage(AbstractPageSequenceLayoutManager.java:284)
        at 
org.apache.fop.layoutmgr.PageBreaker.handleBreakTrait(PageBreaker.java:494)
        at 
org.apache.fop.layoutmgr.PageBreaker.startPart(PageBreaker.java:398)
        at 
org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:421)
        at 
org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:371)
        at 
org.apache.fop.layoutmgr.PageBreaker.doPhase3(PageBreaker.java:262)
        at 
org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:346)
        at 
org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:264)
        at 
org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:106)
        at 
org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:234)
        at 
org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:123)
        at 
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:340)
        at 
org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:169)
        at 
org.apache.xml.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.java:261)
        at 
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1399)
        at 
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)
        at 
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374)
        at 
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)
        at 
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2281)
        at 
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1367)
        at 
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:709)
        at 
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1284)
        at 
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1262)
        at 
com.dnb.components.download.ReportGenerator.generatePDF(Unknown Source)
        at 
com.dnb.components.download.controllers.StreamDownloadController.execute(Unknown 
Source)
        at 
com.dnb.components.web.velocity.VelocityRunner.run(VelocityRunner.java:67)
        at 
com.dnb.components.web.velocity.VelocityRunner.call(VelocityRunner.java:89)
        at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Once again I need a little more help please.

Posted by Jay Bryant <ja...@bryantcs.com>.
>>> 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".
>>
>> Without seeing your XSL for this bit, it's hard to provide a for-sure
>> answer. My initial thought is that you're not checking for the existence
>
> I am posting the files.  No, I don't do the checking, but this is the
> only <bu_line> that gives a problem and they all go through the same code.

I ran the files through Saxon 9 and FOP .95 and didn't see the issue you 
mention. The Trackwork Sales line came out fine. I added the bu_line element 
mentioned earlier in your message (the Tracking Sales one) and still didn't 
get a problem. It's possible that the issue arises because of whichever XSLT 
processor you're using or the version of FOP you have. It's also possible 
that you fixed the issue while fixing some other issue. Let me know if it 
keeps biting you and I'll try to look more deeply.

> Thank you for being so exceedingly helpful.  Now my REAL effort begins.
>  I have to do a log of php coding in order to gather the data and
> generate the xml files that use this xsl file.

You're welcome. I'm that lucky fellow who actually enjoys his job, so doing 
a little weekend programming to help someone out is no problem. I know what 
you mean about the real work. For me, it's Java and SQL (with XML- and 
CSV-based metadata defining things) that do all the heavy lifting. Much as I 
love XSL, it's just the tail end of a much larger and much more complex 
process.

Jay Bryant 


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Once again I need a little more help please.

Posted by Sheldon Glickler <sh...@thevillages.net>.
Jay Bryant wrote:
> Hi, Sheldon,
> 
>> 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".
> 
> Without seeing your XSL for this bit, it's hard to provide a for-sure 
> answer. My initial thought is that you're not checking for the existence 

I am posting the files.  No, I don't do the checking, but this is the 
only <bu_line> that gives a problem and they all go through the same code.

Thank you for being so exceedingly helpful.  Now my REAL effort begins. 
  I have to do a log of php coding in order to gather the data and 
generate the xml files that use this xsl file.

Re: Once again I need a little more help please.

Posted by Jay Bryant <ja...@bryantcs.com>.
Hi, Sheldon,

> 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".

Without seeing your XSL for this bit, it's hard to provide a for-sure 
answer. My initial thought is that you're not checking for the existence of 
the merge element. If you have <fo:table-cell 
number-columns-spanned="{merge}"> but there's no merge element, you get 
<fo:table-cell number-columns-spanned=""> in the FO output. At best, it'll 
be ignored. Instead, use something like this:
<fo:table-cell>
  <xsl:if test="merge &gt; 0">
    <!-- test for the presence of the element, that its value is numeric, 
and that its value is 1 or more -->
    <xsl:attribute name="number-columns-spanned"><xsl:value-of 
select="merge"/></xsl:attribute
  </xsl:if>

Again, though, I'm just guessing. If you want a spot-on answer, post your 
XSLT with the spanning code.

> 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.

First, you should understand that leading and trailing white space is, by 
default, stripped when the transform loads the XML input stream. Think of it 
as having a trim() function run on everything.

However, you can dictate which elements should have their spaces preserved 
and which shouldn't by using the xsl:strip-space and xsl:preserve-space 
elements at the top of your transform.  In looking at your XML, it looks 
like you want to preserve space on the value element, so you'd add 
<xsl:preserve-space elements="value"/> at the top of your transform. Note 
that both instructions take a space-separated list (rather ironic for 
instructions that manage spaces, no?). So, if you had a second element (call 
it widget) on which you needed to preserve spaces, you'd have 
<xsl:preserve-space elements="value widget"/>. Both instructions take 
wildcards, so you can do <xsl:preserve-space elements="*"/> and 
<xsl:strip-space elements="value widget"/> to get exactly the reverse of 
<xsl:preserve-space elements="value widget"/>.

Also (and this ties to your next question), you can always force a space by 
using the trusty old entity for a non-breaking space. Note that you have to 
use the decimal value for it, though (or you have to define an nbsp entity 
somewhere). So you can do things like <fo:block>Force a space 
here:&#160;</fo:block> (160 is the decimal code for an nbsp).

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

XML (and remember that XSL is also XML) defines 5 special entities:
&amp; - the ampersand
&quot; - the double quotation mark
&apos; - the single quotation mark
&lt; - the less than sign (<)
&gt; - the greater than sign (>)

You can always use those 5 entities to get those characters from an XSL 
transform. Assuming your using the UTF-8 character set, you can also use 
just about any character in the set by specifying its decimal value in an 
entity (as I did above for the non-breaking space). In addition to &#160;, I 
use &#8226; (that's a bullet a charater) when I need bullets. I'm sure you 
can find umpteen examples with a quick search.

One heavy caveat: entities are guaranteed to bite you hard if you again 
transform the output of a transform. Consider the trusty ampersand 
character. In your first transform, you insert one with &amp;. Then your 
second transform throws an error complaining that it can't resolve an entity 
because it hit that & character. This leads to weirdness such as: &amp;amp; 
It's far better to make sure all your processing doesn't involve entities 
until the last step in your processing chain.

As a side note, I use Ant to control build processes that sometimes have 
transform after transform (because the process needs to merge data sets and 
such). I make sure that I get all the content in place before I add any 
entities in the formatting step (which has to be the last step for just this 
reason).

>
> 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.

I'm happy to do it. XSL (both T and FO) is a great language, and FOP is a 
great tool. I'm glad to see another person using both.

Jay Bryant 


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Once again I need a little more help please.

Posted by Sheldon Glickler <sh...@thevillages.net>.
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: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Once again I need a little more help please.

Posted by Jay Bryant <ja...@bryantcs.com>.
>>> 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.

> 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.

> 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.

> 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.

> 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.

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.

Jay Bryant


Re: Once again I need a little more help please.

Posted by Sheldon Glickler <sh...@thevillages.net>.
Sheldon Glickler wrote:
> Sheldon Glickler 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;
>>
>> 1 - In the attached files, why are no business units showing up?  I 
>> have looked and looked but can't figure out why they don't.
>>
>> 2 - How do I get the background color to fill the entire cell and not 
>> just the text background.  (When I had the business units data showing 
>> up, the header cell backgrounds filled the entire space).
>>
>> 3 - When the business data did appear earlier, and I viewed at 100%, 
>> the borders did not run into each other and left a small space between 
>> them.  How do I force the borders to join?
>>
>> Thanks for any help.
> 
> I figured out what the answer to (1) is.  I needed to bracket the data 
> in the xml with tags to match the select in the xsl.

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).

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.

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

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

Re: Once again I need a little more help please.

Posted by Sheldon Glickler <sh...@thevillages.net>.
Sheldon Glickler 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;
> 
> 1 - In the attached files, why are no business units showing up?  I have 
> looked and looked but can't figure out why they don't.
> 
> 2 - How do I get the background color to fill the entire cell and not 
> just the text background.  (When I had the business units data showing 
> up, the header cell backgrounds filled the entire space).
> 
> 3 - When the business data did appear earlier, and I viewed at 100%, the 
> borders did not run into each other and left a small space between them. 
>  How do I force the borders to join?
> 
> Thanks for any help.

I figured out what the answer to (1) is.  I needed to bracket the data 
in the xml with tags to match the select in the xsl.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org