Adding an HTML table to your XSL file

You can add an HTML table to your XSL file using the XSL Table wizard. You will base this table on an existing XML file.

The following instructions were written for the Resource perspective, but they will also work in many other perspectives.

Following these steps:

  1. Open your XSL file in the XSL editor.

  2. Click the Snippets tab, open the XSL drawer, and then double-click HTML table in XSL.

  3. Select the XML file you want to use to generate the HTML table.

    Note: If your XSL file is already associated with an XML file, then you will not see this page. For more information about associating XSL files with XML files, refer to the related tasks.

  4. Click Next.

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

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

  7. Select the Wrap table in a template check box if you want the table to be wrapped in a template.

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

  9. Click Next.

  10. You can specify the Table properties:

    1. Specify the Background Color by typing its value in or clicking the button next to the field and selecting it.

    2. Specify the width (in pixels) of the table Border.

    3. Specify the Width (in pixels) of the table.

    4. Specify the Cell spacing (in pixels) for the table. This is the distance between cells in a table.

  11. You can also specify the Row properties:

    1. Specify the Color by typing its value in or clicking the button next to the field and selecting it.

    2. From the Align list, select how you want the horizontal alignment of the table cells to be.

    3. From the Vertical Align list, select how you want the vertical alignment of the table cells to be.

  12. Click Finish.

The HTML table will appear in your XSL file.

 

Parent topic

Editing XSL files

 

Related tasks

Associating XSL files with XML files