Login   Register  
PHP Classes
elePHPant
Icontem

File: Example/persons.xsl

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2 years ago
Size: 1,242 bytes
 

Contents

Class file image Download
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:php="http://php.net/xsl" exclude-result-prefixes="php">

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

  <xsl:template match="template">

    <article>
      <header>
        <h2>The People</h2>
      </header>
      <section>
        <table border="1">
          <tr>
            <th>First Name</th>
            <th>Name</th>
            <td>Description</td>
          </tr>

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

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

            <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>
            </tr>
          </xsl:for-each>
        </table>
      </section>
    </article>

  </xsl:template >
</xsl:stylesheet>