7.6 FileMaker Pro Value Lists and XSL

7.5 XSL and HTML

An XSL stylesheet can be used to transform XML into HTML, a more common method of web delivery. The HTML markup must conform to the XHTML standards. See Chapter 6 for more information about HTML as well-formed XML tags. In addition, Cascading Style Sheets (CSS) may be used in the HTML to provide the formatting. The preferred method of CSS inclusion is with the XHTML <link> element:

 <link rel="stylesheet" type="text/css" href="myStyles.css" /> 

The table row <tr> is generally a repeated element and may be dynamically produced by the XSL elements <xsl:template> or <xsl:for-each>. Furthermore, the table cell element <td> may be dynamically produced by using the templates for field elements. Listing 7.9 shows a simple table produced with the FMPDSORESULT. You can see more XSL examples in the FileMaker Examples folder included with FileMaker Pro 6 and in the XSLT library on the web site http://www.filemaker.com/xml/xslt_library.html.

Listing 7.9: Dynamic table

start example
 <xsl:template match="/">       <table border="1" cellpadding="3" cellspacing="2">             <xsl:for-each select="fmp:ROW">             <tr>                   <xsl:for-each select="./*"> <!-- get all children and display the results -->                   <td>                         <xsl:value-of select="." />                   </td>                   </xsl:for-each>             </tr>             </xsl:for-each>       </table> </xsl:template> 
end example



Filemaker Pro 6 Developer's Guide to XML(s)XSL
FileMaker Pro 6 Developers Guide to XML/XSL (Wordware Library for FileMaker)
ISBN: 155622043X
EAN: 2147483647
Year: 2003
Pages: 100
Authors: Beverly Voth

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net