Extensible Style Sheet Transformations (XSLT)

 <  Day Day Up  >  

XSLT is like a style sheet on steroids. It contains commands to process all of the records in an XML file and generate an XML page displayed as a formatted table. In that sense it's similar to the Data Islands example shown in the preceding section.

The example shown in Listing 7.32 demonstrates how it works.

Listing 7.32. XSLT for Formatting XML
 <?xml version="1.0"?> <xml:stylesheet version= "1.0" xmlns:xsl=http://www.wc.org/1999/XSL/Transform> <xsl:template match="/">  <html>   <head>    <title>XSLT used to format an XML file</title>   </head>   <body>     </xsl:apply-templates/>   </body>  </html> </xsl:template> <xsl:template match="child::clients/child::client">        && use XPATH  <b>CLient:</b> <xsl:value-of select="client/first"/><br/>  <hr color="blue"/> </xsl:template> </xsl:stylesheet> 

To use this, simply include a reference to it in the XML file. The server will send the user the XML file and the XSL file, and the client's browser will combine the two. That way, all of the processing is transferred to the computer that requested the document. Multiply this by a few hundred thousand downloads a day, and you've done made some serious scalability improvements.

 <  Day Day Up  >  


Visual Fox Pro to Visual Basic.NET
Visual FoxPro to Visual Basic .NET
ISBN: 0672326493
EAN: 2147483647
Year: 2004
Pages: 130
Authors: Les Pinter

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