xsl-list
[Top] [All Lists]

Re: [xsl] Pulling xml attributes

2007-06-28 13:12:21
Hi Luke,

<xsl:for-each select = "tbody/row">
You are selecting row here but in the xml you showed,
row has no child element named "colspec"  so

  <xsl:for-each select = "colspec">
does not select anything and therefor you will be missing
the table-column element in your output.

Hope this helps, Manfred


On 28/06/07, Luke Jones <ljones(_at_)leg(_dot_)ne(_dot_)gov> wrote:
XSL Experts,

I have an xml document that contains the tags and attributes I need to
create a table in a pdf document.  I'm using FOP to do this.  The xml
document looks like:

<table>
<tgroup>
<colspec colname="col1" colwidth="2.09" /><colspec align="right"
colname="col2" colwidth="0.82" /><colspec align="right" colname="col3"
colwidth="0.73" /><colspec align="right" colname="col4"
colwidth="0.72" /><colspec align="right" colname="col5"
colwidth="0.67" />
<tbody>
<row>
<entry colsep="0" rowsep="0" />
<entry colsep="0" rowsep="0" />
<entry colsep="0" rowsep="0" />
<entry align="center" colsep="0" rowsep="0">Additional</entry>
<entry colsep="0" rowsep="0" />
</row>
<row>
....
</row
</tbody>
</tgroup>
</table>

I have template that tries to use all of this information to build the
table, and it looks like:

<xsl:template match = "table">
 <xsl:for-each select = "tgroup">
  <xsl:for-each select = "tbody/row">
   <fo:table table-layout = "fixed" width = "100%">
    <xsl:for-each select = "colspec">
     <fo:table-column column-width="{(_at_)colwidth}in"/>
    </xsl:for-each>
    <fo:table-body>
     <fo:table-row>
      <xsl:for-each select = "entry">
       <fo:table-cell>
        <fo:block line-height = "16pt" text-decoration="underline"
font-size="10pt">
         <xsl:value-of select = "." />
        </fo:block>
       </fo:table-cell>
      </xsl:for-each>
     </fo:table-row>
    </fo:table-body>
   </fo:table>
  </xsl:for-each>
 </xsl:for-each>
</xsl:template>

However -- it does not appear that the column-width = "{(_at_)colwidth}in" is
being recognized, because the size specifications are not being put in
there.  Rather it defaults to a proportional size for all the columns.

Does anyone see where the problem might be occurring?

Thanks!
Luke

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>