PHP Classes

File: Example/persons.xsl

Recommend this page to a friend!
  Classes of Pierre-Henry Soria  >  XSLT PHP Template Engine  >  Example/persons.xsl  >  Download  
File: Example/persons.xsl
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: XSLT PHP Template Engine
Process templates using XSLT
Author: By
Last change:
Date: 4 years ago
Size: 1,242 bytes


Class file image Download
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns="" xmlns:xsl="" xmlns:php="" exclude-result-prefixes="php">

<xsl:include href="_layout.xsl" />

  <xsl:template match="template">

        <h2>The People</h2>
        <table border="1">
            <th>First Name</th>

          <xsl:for-each select="persons">
            <xsl:sort select="name" order="ascending" />
            <xsl:sort select="first-name" order="ascending" />

            <xsl:if test="(name = 'admin' or name = 'Admin')">
              <xsl:attribute name="style">background-color:yellow</xsl:attribute>

            <td><xsl:value-of select="first-name" /></td>
              <td><xsl:value-of select="name" /></td>
              <td><xsl:value-of select="php:function('PH7\Library\PH7Xsl\PH7Xsl::escape', string(description), 1)" /></td>

  </xsl:template >