You
can add an HTML table (which
is used to format your output
into an HTML table) to your XSL file using the XSL Table wizard. You
will
base this table on an existing XML file.
About this task
The
following instructions were written for the Resource perspective,
but they will also work in many other perspectives.
Following
these
steps:
Procedure
- Open your XSL file in the XSL
editor.
- Click the Snippets tab,
open the XSL drawer,
and then double-click HTML table in XSL.
- Select the XML file you want to use to generate
the HTML table.
Click Next.
Note: If your XSL file
is already
associated with an XML file, you will not see this page. For more
information
about associating XSL files with XML files, refer to the related tasks.
- Select the context node for the table. The
context node
is used to create an <xsl: for each> element which replicates its
contents
for each of the nodes selected by its select attribute.
- Any elements contained inside the context node are
used to create <xsl:
value-of> elements which return the string value of the expression
given in
the select attribute.
- Select
the Wrap table in a template check
box if you want the table to be wrapped in a template.
- Select the Include header check
box if you
want to include headers with the table. A header is included
for
each element inside the content node.
- Click Next.
- You can specify the Table properties:
- Specify the Background Color by
typing
its value in or clicking the button next to the field and selecting
it.
- Specify the width (in pixels) of
the table Border.
- Specify
the Width (in pixels) of the
table.
- Specify the Cell spacing (in
pixels)
for the table. This is the distance between cells in a
table.
- You can also specify
the Row properties:
- Specify the Color by
typing its value
in or clicking the button next to the field and selecting it.
- From the Align list,
select how you want
the horizontal alignment of the table cells to be.
- From the Vertical Align list,
select
how you want the vertical alignment of the table cells to be.
- Click Finish.
Results
The HTML table code will appear in your XSL
file.