Thank you for your response.
Here is the sample table XML file:
<table id="S0218B7D7" frame="none">
My requirement is simple:
Whenever @rowsep is encountered, it formats the table by setting border-bottom=0px.
How can I acheieve this?
--- On Mon, 12/29/08, G. Ken Holman <gkholman@...> wrote:
From: G. Ken Holman <gkholman@...>
Subject: Re: [XSL-FO] CALS table to XSLFo -@rowsep problem
Date: Monday, December 29, 2008, 4:52 PM
At 2008-12-29 17:07 +0000, mina_hurray wrote:
>I am trying to convert the cals table into FO.
>I am having issues with the @rowsep at an <entry> element. If the
>@rowsep=0, I want that the border-bottom to not be shown. Here is what
>I am attempting to do in the <entry> template: I have just shown the
>@rowsep part here.
><xsl:template match="entry" >
><xsl:variable name="entry" >
><xsl:number level="multiple" format="1" count="entry" />
The above is very wasteful because there is no need to walk away from
the <entry> and go back to it.
><fo:table-cell padding-before= "2pt" padding-after= "2pt">
><!-- ROWSEP rules -->
><xsl:when test="ancestor: :tbody/row/ entry[$entry] /@rowsep= '0'">
Why not just use test="@rowsep= '0'" as the test? What you have there
will check the same column of *every* row, not just the row you are in.
And why use <xsl:choose> when you only have one <xsl:when>? That
could be <xsl:if>.
><xsl:attribute name="border- left"><xsl: value-of select="$FrameWidth "/>
>solid black</xsl:attribut e>
><xsl:attribute name="border- right"><xsl: value-of select="$FrameWidth "/>
>solid black</xsl:attribut e>
><xsl:attribute name="border- top">1px solid black</xsl:attribut e>
><xsl:attribute name="border- bottom">0px< /xsl:attribute>
><fo:block>< xsl:apply- templates/ ></fo:block>
>What I wanted to when I used "ancestor::tbody/ row/entry[ $entry]" was to
>be able to use something like an array to navigate among all the
><entry> elements in a table. But this is not working.
Why all <entry> elements? The above will address only one <entry>
element and it will address the one you are at because of your use of
If you want to check that *any* entry element has rowsep, then you use:
<xsl:if test="../entry[ @rowsep=' 0']">
... which will test all of the entry elements in the same row
checking if any of them has a rowsep='0'. But it won't check for
entries in spanned rows.
But I'm not convinced that is what you want. You say you want an
array (which doesn't exist in XSLT), but you don't say why. What is
the problem you are trying to solve?
>I also want to be able to check if it is the first entry
"not(preceding- sibling:: entry)" will check but will not consider any
spanned cells from above rows.
>and if there are @morerows attributes on the <entry>.
"attributes" plural? I'm not sure what you mean. There could only
be one on <entry> and to check that it is there is:
>But I am not able to get this first step of @rowsep.
Can you please repeat your requirement using sentences and examples
that describe the data you want checked and the result you need from
that data? I cannot interpret what problem you are trying to solve.
I hope the notes above help.
. . . . . . . . . . . Ken
Upcoming XSLT/XSL-FO, UBL and code list hands-on training classes:
: Sydney, AU 2009-01/02; Brussels, BE 2009-03; Prague, CZ 2009-03
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video sample lesson: http://www.youtube. com/watch? v=PrNjJCh7Ppg
Video course overview: http://www.youtube. com/watch? v=VTiodiij6gE
G. Ken Holman mailto:gkholman@CraneSoftw rights.com
Crane Softwrights Ltd. http://www.CraneSof twrights. com/f/
Male Cancer Awareness Nov'07 http://www.CraneSof twrights. com/f/bc
Legal business disclaimers: http://www.CraneSof twrights. com/legal
[Non-text portions of this message have been removed]