conditions.xsl revision 3215
2644N/A<!--
2644N/A ! CDDL HEADER START
2644N/A !
2644N/A ! The contents of this file are subject to the terms of the
2644N/A ! Common Development and Distribution License, Version 1.0 only
2644N/A ! (the "License"). You may not use this file except in compliance
2644N/A ! with the License.
2644N/A !
2644N/A ! You can obtain a copy of the license at
2644N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
2644N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
2644N/A ! See the License for the specific language governing permissions
2644N/A ! and limitations under the License.
2644N/A !
2644N/A ! When distributing Covered Code, include this CDDL HEADER in each
2644N/A ! file and include the License file at
2644N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
2644N/A ! add the following below this CDDL HEADER, with the fields enclosed
2644N/A ! by brackets "[]" replaced with your own identifying information:
2644N/A ! Portions Copyright [yyyy] [name of copyright owner]
2644N/A !
2644N/A ! CDDL HEADER END
2644N/A !
2644N/A !
3215N/A ! Copyright 2008 Sun Microsystems, Inc.
2644N/A ! -->
2644N/A<xsl:stylesheet version="1.0" xmlns:adm="http://www.opends.org/admin"
2644N/A xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
2644N/A <!--
2644N/A
2644N/A
2644N/A
2644N/A Rules for compiling conditions from their XML definition.
2644N/A
2644N/A
2644N/A
2644N/A -->
2644N/A <!--
2644N/A and condition
2644N/A -->
2644N/A <xsl:template match="adm:and" mode="compile-condition">
2644N/A <xsl:value-of select="'Conditions.and('" />
2644N/A <xsl:for-each select="*">
2644N/A <xsl:apply-templates select="." mode="compile-condition" />
2644N/A <xsl:if test="position() != last()">
2644N/A <xsl:value-of select="', '" />
2644N/A </xsl:if>
2644N/A </xsl:for-each>
2644N/A <xsl:value-of select="')'" />
2644N/A </xsl:template>
2644N/A <!--
2644N/A or condition
2644N/A -->
2644N/A <xsl:template match="adm:or" mode="compile-condition">
2644N/A <xsl:value-of select="'Conditions.or('" />
2644N/A <xsl:for-each select="*">
2644N/A <xsl:apply-templates select="." mode="compile-condition" />
2644N/A <xsl:if test="position() != last()">
2644N/A <xsl:value-of select="', '" />
2644N/A </xsl:if>
2644N/A </xsl:for-each>
2644N/A <xsl:value-of select="')'" />
2644N/A </xsl:template>
2644N/A <!--
2644N/A not condition
2644N/A -->
2644N/A <xsl:template match="adm:not" mode="compile-condition">
2644N/A <xsl:value-of select="'Conditions.not('" />
2644N/A <xsl:apply-templates select="*[1]" mode="compile-condition" />
2644N/A <xsl:value-of select="')'" />
2644N/A </xsl:template>
2644N/A <!--
2644N/A implies condition
2644N/A -->
2644N/A <xsl:template match="adm:implies" mode="compile-condition">
2644N/A <xsl:value-of select="'Conditions.implies('" />
2644N/A <xsl:apply-templates select="*[1]" mode="compile-condition" />
2644N/A <xsl:value-of select="', '" />
2644N/A <xsl:apply-templates select="*[2]" mode="compile-condition" />
2644N/A <xsl:value-of select="')'" />
2644N/A </xsl:template>
2644N/A <!--
2644N/A contains condition
2644N/A -->
2644N/A <xsl:template match="adm:contains" mode="compile-condition">
2644N/A <xsl:value-of
2644N/A select="concat('Conditions.contains(&quot;', @property, '&quot;, &quot;', @value, '&quot;)')" />
2644N/A </xsl:template>
2644N/A <!--
2644N/A is-present condition
2644N/A -->
2644N/A <xsl:template match="adm:is-present" mode="compile-condition">
2644N/A <xsl:value-of
2644N/A select="concat('Conditions.isPresent(&quot;', @property, '&quot;)')" />
2644N/A </xsl:template>
2644N/A</xsl:stylesheet>