home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / portal.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  5.1 KB  |  164 lines

  1. <?xml version="1.0"?>
  2. <!--
  3.   Copyright 1999-2004 The Apache Software Foundation
  4.  
  5.   Licensed under the Apache License, Version 2.0 (the "License");
  6.   you may not use this file except in compliance with the License.
  7.   You may obtain a copy of the License at
  8.  
  9.       http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11.   Unless required by applicable law or agreed to in writing, software
  12.   distributed under the License is distributed on an "AS IS" BASIS,
  13.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.   See the License for the specific language governing permissions and
  15.   limitations under the License.
  16. -->
  17.  
  18. <!-- $Id: portal.xsl,v 1.3 2004/03/06 02:25:39 antonio Exp $ 
  19.  
  20. -->
  21.  
  22. <xsl:stylesheet version="1.0" 
  23.                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  24.  
  25. <xsl:template match="ROWSET">
  26.     <xsl:apply-templates/>
  27. </xsl:template>
  28.  
  29. <xsl:template match="ROW">
  30.     <xsl:apply-templates/>
  31. </xsl:template>
  32.  
  33. <xsl:template match="userdelta">
  34.     <xsl:choose>
  35.     <xsl:when test="user-delta">
  36.             <xsl:apply-templates select="user-delta"/>
  37.     </xsl:when>
  38.     <xsl:otherwise>
  39.     <user-delta/>
  40.     </xsl:otherwise>
  41.     </xsl:choose>
  42. </xsl:template>
  43.  
  44. <xsl:template match="roledelta">
  45.     <xsl:choose>
  46.         <xsl:when test="*">
  47.                 <xsl:apply-templates/>
  48.         </xsl:when>
  49.         <xsl:otherwise>
  50.             <role-delta/>
  51.         </xsl:otherwise>
  52.     </xsl:choose>
  53. </xsl:template>
  54.  
  55. <xsl:template match="statusprofile">
  56.     <xsl:choose>
  57.         <xsl:when test="*">
  58.                 <xsl:apply-templates/>
  59.         </xsl:when>
  60.         <xsl:otherwise>
  61.             <status-profile/>
  62.         </xsl:otherwise>
  63.     </xsl:choose>
  64. </xsl:template>
  65.  
  66.  
  67. <xsl:template match="loaduser">
  68.     <xsl:apply-templates select="authentication/users"/>
  69. </xsl:template>
  70.  
  71.  
  72. <xsl:template match="authentication/users">
  73.     <users>
  74.         <xsl:for-each select="user">
  75.             <xsl:call-template name="includeuser"/>
  76.         </xsl:for-each>
  77.     </users>
  78. </xsl:template>
  79.  
  80.  
  81. <xsl:template name="includeuser">
  82.     <xsl:variable name="type"><xsl:value-of select="normalize-space(ancestor::loaduser/info/type)"/></xsl:variable>
  83.     <xsl:variable name="name"><xsl:value-of select="normalize-space(ancestor::loaduser/info/ID)"/></xsl:variable>
  84.       <xsl:variable name="role"><xsl:value-of select="normalize-space(ancestor::loaduser/info/role)"/></xsl:variable>
  85.     
  86.     <xsl:choose>
  87.         <xsl:when test="normalize-space(role) = $role and ($type='users' or normalize-space(name) = $name)"> 
  88.             <user>
  89.                 <ID><xsl:value-of select="name"/></ID>
  90.                 <role><xsl:value-of select="role"/></role>
  91.                 <data>
  92.                     <password><xsl:value-of select="password"/></password>
  93.                     <name><xsl:value-of select="name"/></name>
  94.                     <role><xsl:value-of select="role"/></role>
  95.                     <ID><xsl:value-of select="name"/></ID>
  96.                     <user><xsl:value-of select="name"/></user>
  97.                     <title><xsl:value-of select="title"/></title>
  98.                     <firstname><xsl:value-of select="firstname"/></firstname>
  99.                     <lastname><xsl:value-of select="lastname"/></lastname>
  100.                     <company><xsl:value-of select="company"/></company>
  101.                     <street><xsl:value-of select="street"/></street>
  102.                     <zipcode><xsl:value-of select="zipcode"/></zipcode>
  103.                     <city><xsl:value-of select="city"/></city>
  104.                     <country><xsl:value-of select="country"/></country>
  105.                     <phone><xsl:value-of select="phone"/></phone>
  106.                     <fax><xsl:value-of select="fax"/></fax>
  107.                     <email><xsl:value-of select="email"/></email>
  108.                     <bankid><xsl:value-of select="bankid"/></bankid>
  109.                     <bankname><xsl:value-of select="bankname"/></bankname>
  110.                     <accountid><xsl:value-of select="accountid"/></accountid>
  111.                 </data>
  112.             </user>
  113.         </xsl:when>
  114.         <xsl:when test="$type='users' and string-length($role) = 0">
  115.             <user>
  116.                 <ID><xsl:value-of select="name"/></ID>
  117.                 <role><xsl:value-of select="role"/></role>
  118.                 <data>
  119.                     <password><xsl:value-of select="password"/></password>
  120.                     <name><xsl:value-of select="name"/></name>
  121.                     <role><xsl:value-of select="role"/></role>
  122.                     <ID><xsl:value-of select="name"/></ID>
  123.                     <user><xsl:value-of select="name"/></user>
  124.                     <title><xsl:value-of select="title"/></title>
  125.                     <firstname><xsl:value-of select="firstname"/></firstname>
  126.                     <lastname><xsl:value-of select="lastname"/></lastname>
  127.                     <company><xsl:value-of select="company"/></company>
  128.                     <street><xsl:value-of select="street"/></street>
  129.                     <zipcode><xsl:value-of select="zipcode"/></zipcode>
  130.                     <city><xsl:value-of select="city"/></city>
  131.                     <country><xsl:value-of select="country"/></country>
  132.                     <phone><xsl:value-of select="phone"/></phone>
  133.                     <fax><xsl:value-of select="fax"/></fax>
  134.                     <email><xsl:value-of select="email"/></email>
  135.                     <bankid><xsl:value-of select="bankid"/></bankid>
  136.                     <bankname><xsl:value-of select="bankname"/></bankname>
  137.                     <accountid><xsl:value-of select="accountid"/></accountid>
  138.                 </data>
  139.             </user>
  140.         </xsl:when>
  141.     </xsl:choose>
  142. </xsl:template>
  143.  
  144. <xsl:template match="role">
  145.     <xsl:apply-templates select="role-delta"/>
  146. </xsl:template>
  147.  
  148. <xsl:template match="roles">
  149.     <roles>
  150.         <xsl:for-each select="role">
  151.             <role><xsl:value-of select="."/></role>
  152.         </xsl:for-each>
  153.     </roles>
  154. </xsl:template>
  155.  
  156. <!-- Copy all and apply templates -->
  157. <xsl:template match="@*|node()">
  158.     <xsl:copy>
  159.         <xsl:apply-templates select="@*|node()" />
  160.     </xsl:copy>
  161. </xsl:template>
  162.  
  163. </xsl:stylesheet>
  164.