http://www.zorba-xquery.com/modules/languages/xslt

View as XML or JSON.

This module provides XSLT 1.0 transformation functionality.

For details on XSLT see XSLT 1.0 specification.

This module implements the invoking of an XSLT transformation from XQuery described in Michael Kay's proposal.

Example:

import module namespace
        xslt = "http://www.zorba-xquery.com/modules/languages/xslt";
 let $source :=
     <catalog>
         <cd>
           <title>Empire Burlesque</title>
           <artist>Bob Dylan</artist>
           <country>USA</country>
           <company>Columbia</company>
           <price>10.90</price>
           <year>1985</year>
         </cd>
         <cd>
           <title>Hide your heart</title>
           <artist>Bonnie Tyler</artist>
           <country>UK</country>
           <company>CBS Records</company>
           <price>9.90</price>
           <year>1988</year>
         </cd>
     </catalog>
 let $stylesheet :=
   <xsl:stylesheet version="1.0"
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:template match="/">
       <html>
       <body>
       <h2>Music Collection&lt;/h2>
         <table border="1">
           <tr bgcolor="lightblue">
             <th>Title&lt;/th>
             <th>Artist&lt;/th>
           </tr>
           <xsl:for-each select="catalog/cd">
            <tr>
              <td>&lt;xsl:value-of select="title"/></td>
              <td>&lt;xsl:value-of select="artist"/></td>
           </tr>
           </xsl:for-each>
         </table>
       </body>
       </html>
     </xsl:template>
   </xsl:stylesheet>
 return
   xslt:transform( $source, $stylesheet)

Function Summary

transform ($source as node(), $stylesheet as node()) as node() external

Invokes an XSLT transformation.

Functions

transform#2

declare  function xslt:transform($source as node(), $stylesheet as node()) as node() external

Invokes an XSLT transformation.

Parameters

source as node()
the input document to the transformation
stylesheet as node()
the XSLT stylesheet module

Returns

node()
the result tree produced by the transformation