8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac<!--
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac ! CDDL HEADER START
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift !
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift ! The contents of this file are subject to the terms of the
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift ! Common Development and Distribution License, Version 1.0 only
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift ! (the "License"). You may not use this file except in compliance
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift ! with the License.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift !
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac ! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac ! or http://forgerock.org/license/CDDLv1.0.html.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift ! See the License for the specific language governing permissions
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift ! and limitations under the License.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift !
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift ! When distributing Covered Code, include this CDDL HEADER in each
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac ! file and include the License file at legal-notices/CDDLv1_0.txt.
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac ! If applicable, add the following below this CDDL HEADER, with the
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac ! fields enclosed by brackets "[]" replaced with your own identifying
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac ! information:
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift ! Portions Copyright [yyyy] [name of copyright owner]
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift !
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift ! CDDL HEADER END
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift !
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift !
72e934bdd76d612e7d4ee1b76acb57adb6fc851dludovicp ! Copyright 2008-2010 Sun Microsystems, Inc.
48224cd6d19e80b2152d9d0d8b830b6b15542fc1matthew ! Portions copyright 2011 ForgeRock AS.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift ! -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift<xsl:stylesheet version="1.0" xmlns:adm="http://www.opends.org/admin"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift xmlns:admpp="http://www.opends.org/admin-preprocessor"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
72e934bdd76d612e7d4ee1b76acb57adb6fc851dludovicp xmlns:exsl="http://exslt.org/common"
72e934bdd76d612e7d4ee1b76acb57adb6fc851dludovicp xmlns:file="xalan://java.io.File">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:import href="java-utilities.xsl" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:output method="xml" indent="yes" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Global parameter: the absolute path of the base directory where
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift XML managed object definitions can be found.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="base-dir" select="'.'" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Get an absolute URI from a package, object name, and suffix.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:template name="get-uri">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="package" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="name" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="suffix" select="'.xml'" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Convert the package name to a relative path.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="rpath" select="translate($package, '.', '/')" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Convert the managed object name to a file name.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="java-name">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:call-template name="name-to-java">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="value" select="$name" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:call-template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:variable>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Get the absolute path.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
72e934bdd76d612e7d4ee1b76acb57adb6fc851dludovicp <xsl:variable name="base-file" select="file:new($base-dir)" />
72e934bdd76d612e7d4ee1b76acb57adb6fc851dludovicp <xsl:variable name="base-dir-uri" select="file:toURI($base-file)" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of
72e934bdd76d612e7d4ee1b76acb57adb6fc851dludovicp select="concat($base-dir-uri, '/', $rpath, '/', $java-name, $suffix)" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Get the URI of the named package definition.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:template name="get-package-uri">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="package" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:call-template name="get-uri">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="package" select="$package" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="name" select="'package'" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:call-template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Get the URI of the named managed object definition.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:template name="get-managed-object-uri">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="package" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="name" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:call-template name="get-uri">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="package" select="$package" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="name"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="concat($name, '-configuration')" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:call-template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Pre-process the current managed object element.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:template name="pre-process-managed-object">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:if test="not(adm:root-managed-object | adm:managed-object)">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:message terminate="yes">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="'No managed object definition found.'" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:message>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="adm:root-managed-object | adm:managed-object"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift mode="pre-process" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Pre-process a managed object definition: pull in the managed object's
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift inherited property definitions and relations.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:template match="adm:managed-object" mode="pre-process">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:if test="not(@name)">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:message terminate="yes">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="'Managed object definition does not specify managed object name.'" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:message>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:if test="not(@package)">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:message terminate="yes">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="'Managed object definition does not specify managed object package.'" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:message>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="parent-name" select="@extends" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="parent-package">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift The parent package defaults to this managed object's package.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:when test="@parent-package">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="@parent-package" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:when>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="@package" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:variable>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Get this managed object's hierarchy if there is one.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="_hierarchy">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:if test="$parent-name">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="uri">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:call-template name="get-managed-object-uri">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="package" select="$parent-package" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="name" select="$parent-name" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:call-template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:variable>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:if test="not(document($uri)/adm:managed-object)">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:message terminate="yes">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="concat('No managed object definition found in ', $uri, '.')" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:message>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:if
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift test="not(document($uri)/adm:managed-object[@name=$parent-name and @package=$parent-package])">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:message terminate="yes">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="concat('Managed object definition found in ', $uri, ' but it did not define a managed object ', $parent-name, ' in package ', $parent-package, '.')" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:message>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates select="document($uri)/adm:managed-object"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift mode="pre-process" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:variable>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="hierarchy" select="exsl:node-set($_hierarchy)" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Now pre-process this managed object.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Shallow copy this element and its attributes.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy-of select="@*" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Pre-process this managed object's elements.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift select="adm:TODO|adm:synopsis|adm:description"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift mode="pre-process">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="moname" select="@name" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="mopackage" select="@package" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <!--
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift Copy all inherited tags plus locally defined tags.
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift -->
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:copy-of select="$hierarchy/adm:managed-object/adm:tag" />
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:apply-templates select="adm:tag" mode="pre-process">
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:with-param name="moname" select="@name" />
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:with-param name="mopackage" select="@package" />
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift </xsl:apply-templates>
0c45338572f2f6593fea8fc9e70bcb9ef3a6d2f8matthew_swift <!--
0c45338572f2f6593fea8fc9e70bcb9ef3a6d2f8matthew_swift Copy constraint elements.
0c45338572f2f6593fea8fc9e70bcb9ef3a6d2f8matthew_swift -->
0c45338572f2f6593fea8fc9e70bcb9ef3a6d2f8matthew_swift <xsl:apply-templates select="adm:constraint" mode="pre-process">
0c45338572f2f6593fea8fc9e70bcb9ef3a6d2f8matthew_swift <xsl:with-param name="moname" select="@name" />
0c45338572f2f6593fea8fc9e70bcb9ef3a6d2f8matthew_swift <xsl:with-param name="mopackage" select="@package" />
0c45338572f2f6593fea8fc9e70bcb9ef3a6d2f8matthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
0c45338572f2f6593fea8fc9e70bcb9ef3a6d2f8matthew_swift </xsl:apply-templates>
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <!--
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift Copy profile elements.
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift -->
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:apply-templates select="adm:profile" mode="pre-process">
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:with-param name="moname" select="@name" />
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:with-param name="mopackage" select="@package" />
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Add a pre-processor element defining this managed object's uppermost
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift definition.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:if test="$parent-name">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:element name="adm:profile">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:attribute name="name">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="'preprocessor'" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:attribute>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:element name="admpp:parent-managed-object">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:attribute name="name">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$parent-name" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:attribute>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:attribute name="package">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$parent-package" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:attribute>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:element>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy-of
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="$hierarchy/adm:managed-object/adm:profile[@name='preprocessor']/admpp:parent-managed-object" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:element>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Copy all inherited relations.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy-of select="$hierarchy/adm:managed-object/adm:relation" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Copy all local relations.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates select="adm:relation" mode="pre-process">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="moname" select="@name" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="mopackage" select="@package" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Copy all inherited properties.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:variable name="property-overrides"
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift select="adm:property-override" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:copy-of
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift select="$hierarchy/adm:managed-object/adm:property[not(@name=$property-overrides/@name)]" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Copy all local properties.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:apply-templates
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift select="adm:property|adm:property-reference|adm:property-override"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift mode="pre-process">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="moname" select="@name" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="mopackage" select="@package" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:copy>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Pre-process a managed object definition: pull in the managed object's
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift inherited property definitions and relations.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:template match="adm:root-managed-object" mode="pre-process">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Now pre-process this root managed object.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift By definition it has no hierarchy.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Shallow copy this element and its attributes.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy-of select="@*" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Pre-process this managed object's elements.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates mode="pre-process">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="moname" select="'root'" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="mopackage"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="'org.opends.server.admin.std'" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:copy>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:template>
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <!--
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift Pre-process a tag and validate it and by adding a "preprocessor"
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift profile which contains information about where the tag was defined.
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift -->
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:template match="adm:tag" mode="pre-process">
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:param name="mopackage" select="/.." />
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:param name="moname" select="/.." />
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:param name="hierarchy" />
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <!--
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift Make sure that this tag is not duplicated.
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift -->
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:variable name="name" select="@name" />
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:if test="/adm:tag[@name=$name][2]">
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:message terminate="yes">
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:value-of
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift select="concat('Tag ', @name, ' is already defined in this managed object')" />
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift </xsl:message>
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift </xsl:if>
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <!--
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift Make sure that this tag does not override an existing tag.
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift -->
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:if test="$hierarchy/adm:managed-object/adm:tag[@name=$name]">
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:message terminate="yes">
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:value-of
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift select="concat('Tag ', @name, ' is already defined in a parent managed object')" />
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift </xsl:message>
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift </xsl:if>
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <!--
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift Get the referenced package.
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift -->
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:variable name="uri">
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:call-template name="get-managed-object-uri">
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:with-param name="package"
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift select="'org.opends.server.admin.std'" />
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:with-param name="name" select="'root'" />
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift </xsl:call-template>
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift </xsl:variable>
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:if test="not(document($uri)/adm:root-managed-object)">
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:message terminate="yes">
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:value-of
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift select="concat('Root managed object definition not found in ', $uri, '.')" />
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift </xsl:message>
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift </xsl:if>
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:if
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift test="not(document($uri)/adm:root-managed-object/adm:tag-definition[@name=$name])">
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:message terminate="yes">
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:value-of
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift select="concat('Tag &quot;', $name,
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift '&quot; not defined in root managed object definition.')" />
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift </xsl:message>
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift </xsl:if>
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <!--
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift Copy the tag.
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift -->
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:element name="adm:tag">
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:copy-of select="@*" />
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:apply-templates mode="pre-process">
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:with-param name="moname" select="$moname" />
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift <xsl:with-param name="mopackage" select="$mopackage" />
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift </xsl:apply-templates>
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift </xsl:element>
408b8eb145348cb8f251a8abfec96e7e4e80f630matthew_swift </xsl:template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Pre-process a property definition by adding a "preprocessor" profile
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift which contains information about where the property was defined.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:template match="adm:property" mode="pre-process">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="mopackage" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="moname" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="hierarchy" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Make sure that this property does not have the same name as another
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift property or reference in this managed object.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="name" select="@name" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:if
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift test="/adm:property[@name=$name][2] |
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift /adm:property-reference[@name=$name]">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:message terminate="yes">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="concat('Property definition ', @name, ' is already defined in this managed object')" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:message>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Make sure that this property does not override an existing property.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:if
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift test="$hierarchy/adm:managed-object/adm:property[@name=$name]">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:message terminate="yes">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="concat('Property definition ', @name, ' is already defined in a parent managed object')" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:message>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Shallow copy this element and its attributes.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy-of select="@*" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Apply templates to subordinate elements (e.g. descriptions).
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates mode="pre-process">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="mopackage" select="$mopackage" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="moname" select="$moname" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Now append the preprocessor profile.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:element name="adm:profile">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:attribute name="name">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="'preprocessor'" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:attribute>
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift <xsl:element name="admpp:last-defined-in">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:attribute name="name">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$moname" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:attribute>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:attribute name="package">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$mopackage" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:attribute>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:element>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:element>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:copy>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Pre-process a property reference pulling in the referenced property
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift definition and by adding a "preprocessor" profile which contains
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift information about where the property was defined.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:template match="adm:property-reference" mode="pre-process">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="mopackage" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="moname" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="hierarchy" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Make sure that this property reference does not have the same name as another
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift property or reference in this managed object.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="name" select="@name" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:if
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift test="/adm:property[@name=$name] |
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift /adm:property-reference[@name=$name][2]">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:message terminate="yes">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="concat('Property definition ', @name, ' is already defined in this managed object')" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:message>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Make sure that this property does not override an existing property.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:if
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift test="$hierarchy/adm:managed-object/adm:property[@name=$name]">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:message terminate="yes">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="concat('Property reference ', @name, ' is already defined in a parent managed object')" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:message>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Determine the package containing the reference property definition.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="package">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:when test="@package">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="@package" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:when>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$mopackage" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:variable>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Get the referenced package.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="uri">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:call-template name="get-package-uri">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="package" select="$package" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:call-template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:variable>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:if test="not(document($uri)/adm:package)">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:message terminate="yes">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="concat('No package definition found in ', $uri, '.')" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:message>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:if test="not(document($uri)/adm:package[@name=$package])">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:message terminate="yes">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="concat('Package definition found in ', $uri, ' but it did not define package ', $package, '.')" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:message>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:if
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift test="not(document($uri)/adm:package[@name=$package]/adm:property[@name=$name])">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:message terminate="yes">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="concat('Referenced property definition &quot;', $name,
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift '&quot; not found in package definition &quot;', $package,
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift '&quot;.')" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:message>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Copy the referenced property definition taking care to override
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift the default behavior and admin action if required.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="property"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="document($uri)/adm:package[@name=$package]/adm:property[@name=$name]" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:element name="adm:property">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy-of select="$property/@*" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="$property/adm:TODO | $property/adm:synopsis | $property/adm:description"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift mode="pre-process">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="mopackage" select="$mopackage" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="moname" select="$moname" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:when test="adm:requires-admin-action">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates select="adm:requires-admin-action"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift mode="pre-process">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="mopackage" select="$mopackage" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="moname" select="$moname" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:when>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="$property/adm:requires-admin-action"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift mode="pre-process">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="mopackage" select="$mopackage" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="moname" select="$moname" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:when test="adm:default-behavior">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates select="adm:default-behavior"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift mode="pre-process">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="mopackage" select="$mopackage" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="moname" select="$moname" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:when>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates select="$property/adm:default-behavior"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift mode="pre-process">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="mopackage" select="$mopackage" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="moname" select="$moname" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="$property/adm:syntax | $property/adm:profile"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift mode="pre-process">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="mopackage" select="$mopackage" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="moname" select="$moname" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Now append the preprocessor profile.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:element name="adm:profile">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:attribute name="name">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="'preprocessor'" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:attribute>
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift <xsl:element name="admpp:last-defined-in">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:attribute name="name">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$moname" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:attribute>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:attribute name="package">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$mopackage" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:attribute>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:element>
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift <xsl:element name="admpp:first-defined-in">
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift <xsl:attribute name="package">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$package" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:attribute>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:element>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:element>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:element>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:template>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <!--
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift Pre-process a property override pulling in the inherited property
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift definition and by adding a "preprocessor" profile which contains
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift information about where the property was redefined.
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift -->
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:template match="adm:property-override" mode="pre-process">
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:param name="mopackage" select="/.." />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:param name="moname" select="/.." />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:param name="hierarchy" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <!--
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift Make sure that this property override does not have the same name as another
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift property override in this managed object.
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift -->
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:variable name="name" select="@name" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:if test="/adm:property-override[@name=$name][2]">
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:message terminate="yes">
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:value-of
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift select="concat('Property override ', @name, ' is already overridden in this managed object')" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:message>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:if>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <!--
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift Make sure that this property overrides an existing property.
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift -->
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:if
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift test="not($hierarchy/adm:managed-object/adm:property[@name=$name])">
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:message terminate="yes">
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:value-of
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift select="concat('Cannot find inherited property ', @name, ' for property override')" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:message>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:if>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <!--
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift Copy the inherited property definition taking care to override
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift the default behavior and admin action if required.
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift -->
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:variable name="property"
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift select="$hierarchy/adm:managed-object/adm:property[@name=$name]" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:element name="adm:property">
188a85993cf1cf9925338176e5f27b95a5891c50matthew_swift <xsl:copy-of select="$property/@*[local-name() != 'advanced']" />
188a85993cf1cf9925338176e5f27b95a5891c50matthew_swift <xsl:choose>
188a85993cf1cf9925338176e5f27b95a5891c50matthew_swift <xsl:when test="@advanced">
188a85993cf1cf9925338176e5f27b95a5891c50matthew_swift <xsl:copy-of select="@advanced" />
188a85993cf1cf9925338176e5f27b95a5891c50matthew_swift </xsl:when>
188a85993cf1cf9925338176e5f27b95a5891c50matthew_swift <xsl:otherwise>
188a85993cf1cf9925338176e5f27b95a5891c50matthew_swift <xsl:copy-of select="$property/@advanced" />
188a85993cf1cf9925338176e5f27b95a5891c50matthew_swift </xsl:otherwise>
188a85993cf1cf9925338176e5f27b95a5891c50matthew_swift </xsl:choose>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:apply-templates
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift select="$property/adm:TODO | $property/adm:synopsis | $property/adm:description"
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift mode="pre-process">
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:with-param name="mopackage" select="$mopackage" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:with-param name="moname" select="$moname" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:apply-templates>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:choose>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:when test="adm:requires-admin-action">
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:apply-templates select="adm:requires-admin-action"
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift mode="pre-process">
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:with-param name="mopackage" select="$mopackage" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:with-param name="moname" select="$moname" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:apply-templates>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:when>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:otherwise>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:apply-templates
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift select="$property/adm:requires-admin-action"
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift mode="pre-process">
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:with-param name="mopackage" select="$mopackage" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:with-param name="moname" select="$moname" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:apply-templates>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:otherwise>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:choose>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:choose>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:when test="adm:default-behavior">
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:apply-templates select="adm:default-behavior"
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift mode="pre-process">
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:with-param name="mopackage" select="$mopackage" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:with-param name="moname" select="$moname" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:apply-templates>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:when>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:otherwise>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:apply-templates select="$property/adm:default-behavior"
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift mode="pre-process">
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:with-param name="mopackage" select="$mopackage" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:with-param name="moname" select="$moname" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:apply-templates>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:otherwise>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:choose>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:apply-templates
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift select="$property/adm:syntax | $property/adm:profile[@name!='preprocessor']"
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift mode="pre-process">
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:with-param name="mopackage" select="$mopackage" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:with-param name="moname" select="$moname" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:apply-templates>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <!--
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift Now append the preprocessor profile.
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift -->
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:element name="adm:profile">
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:attribute name="name">
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:value-of select="'preprocessor'" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:attribute>
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift <xsl:element name="admpp:last-defined-in">
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:attribute name="name">
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:value-of select="$moname" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:attribute>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:attribute name="package">
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift <xsl:value-of select="$mopackage" />
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:attribute>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:element>
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift <xsl:choose>
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift <xsl:when
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift test="$property/adm:profile[@name='preprocessor']/admpp:first-defined-in">
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift <xsl:copy-of
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift select="$property/adm:profile[@name='preprocessor']/admpp:first-defined-in" />
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift </xsl:when>
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift <xsl:otherwise>
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift <xsl:element name="admpp:first-defined-in">
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift <xsl:copy-of
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift select="$property/adm:profile[@name='preprocessor']/admpp:last-defined-in/@*" />
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift </xsl:element>
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift </xsl:otherwise>
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift </xsl:choose>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:element>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:element>
91940c5122d22be4fd20bc41db2ffc4a9ba4ce59matthew_swift </xsl:template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Pre-process a relation, merging information from the referenced
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift managed object where required, and by adding a "preprocessor" profile
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift which contains information about where the relation was defined.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:template match="adm:relation" mode="pre-process">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="mopackage" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="moname" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="hierarchy" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Determine the name of the relation.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="name" select="@name" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Make sure that this relation does not override an existing relation.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:if
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift test="$hierarchy/adm:managed-object/adm:relation[@name=$name]">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:message terminate="yes">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="concat('Relation ', $name, ' is already defined in a parent managed object.')" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:message>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Make sure that this relation is not already defined in this managed object.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:if test="/adm:relation[@name=$name][2]">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:message terminate="yes">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="concat('Relation ', $name, ' is already defined in this managed object.')" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:message>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Now get the referenced managed object.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="mname">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:when test="not(@managed-object-name)">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$name" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:when>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="@managed-object-name" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:variable>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="mpackage">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:when test="not(@managed-object-package)">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$mopackage" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:when>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="@managed-object-package" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:variable>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="uri">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:call-template name="get-managed-object-uri">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="name" select="$mname" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="package" select="$mpackage" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:call-template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:variable>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="managed-object"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="document($uri)/adm:managed-object[@name=$mname]" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:if test="not($managed-object)">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:message terminate="yes">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="concat('Managed object definition &quot;', $mname, '&quot; not found in ', $uri, '.')" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:message>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Now merge the relation.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy-of select="@*" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Add missing attribute managed-object-name if it is not provided.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:if test="not(@managed-object-name)">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:attribute name="managed-object-name">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$mname" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:attribute>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Add missing attribute managed-object-package if it is not provided.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:if test="not(@managed-object-package)">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:attribute name="managed-object-package">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$mpackage" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:attribute>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Copy TODO element.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy-of select="adm:TODO" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Copy synopsis element from referenced managed object if it is undefined.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:when test="adm:synopsis">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates select="adm:synopsis"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift mode="merge-relation">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="managed-object"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="$managed-object" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:when>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates select="$managed-object/adm:synopsis"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift mode="merge-relation">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="managed-object"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="$managed-object" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Copy description element from referenced managed object if it is undefined.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:when test="adm:description">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates select="adm:description"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift mode="merge-relation">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="managed-object"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="$managed-object" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:when>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates select="$managed-object/adm:description"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift mode="merge-relation">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="managed-object"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="$managed-object" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Merge remaining elements.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="*[not(self::adm:TODO|self::adm:synopsis|self::adm:description)]"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift mode="merge-relation">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="managed-object" select="$managed-object" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Now append the preprocessor profile.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:element name="adm:profile">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:attribute name="name">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="'preprocessor'" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:attribute>
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift <xsl:element name="admpp:last-defined-in">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:attribute name="name">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$moname" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:attribute>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:attribute name="package">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$mopackage" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:attribute>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:element>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:element>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:copy>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Default template for merging relations.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:template match="*|comment()" mode="merge-relation">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="managed-object" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy-of select="@*" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates mode="merge-relation">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="managed-object" select="$managed-object" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:copy>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:template>
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift <!--
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift Merge a default managed object.
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift -->
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift <xsl:template match="adm:default-managed-object" mode="merge-relation">
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift <xsl:param name="managed-object" select="/.." />
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift <xsl:copy>
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift <xsl:copy-of select="@*" />
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift <!--
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift Add missing attribute managed-object-name if it is not provided.
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift -->
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift <xsl:if test="not(@managed-object-name)">
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift <xsl:attribute name="managed-object-name">
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift <xsl:value-of select="$managed-object/@name" />
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift </xsl:attribute>
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift </xsl:if>
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift <!--
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift Add missing attribute managed-object-package if it is not provided.
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift -->
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift <xsl:if test="not(@managed-object-package)">
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift <xsl:attribute name="managed-object-package">
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift <xsl:value-of select="$managed-object/@package" />
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift </xsl:attribute>
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift </xsl:if>
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift <xsl:apply-templates mode="merge-relation">
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift <xsl:with-param name="managed-object" select="$managed-object" />
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift </xsl:apply-templates>
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift </xsl:copy>
7edb1a6332a5678c67bfa236b629d47cab1525c1matthew_swift </xsl:template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Merge a one-to-many relation.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:template match="adm:one-to-many" mode="merge-relation">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="managed-object" select="/.." />
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift <!--
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift Make sure that if this relation uses a naming property that the
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift naming property exists, is single-valued, mandatory, and read-only.
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift -->
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift <xsl:if test="@naming-property">
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift <xsl:variable name="naming-property-name"
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift select="@naming-property" />
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift <!--
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift FIXME: this does not cope with the situation where the property
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift is inherited, referenced, or overridden.
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift -->
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift <xsl:variable name="naming-property"
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift select="$managed-object/adm:property[@name=$naming-property-name]" />
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift <xsl:if test="not($naming-property)">
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift <xsl:message terminate="yes">
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift <xsl:value-of
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift select="concat('Relation ', ../@name,
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift ' references an unknown naming property ',
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift $naming-property-name, ' in ',
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift $managed-object/@name, '.')" />
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift </xsl:message>
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift </xsl:if>
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift <xsl:if test="not($naming-property/@read-only='true')">
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift <xsl:message terminate="yes">
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift <xsl:value-of
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift select="concat('Relation ', ../@name,
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift ' references the naming property ',
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift $naming-property-name, ' in ',
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift $managed-object/@name, ' which is not read-only. ',
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift 'Naming properties must be read-only.')" />
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift </xsl:message>
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift </xsl:if>
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift <xsl:if test="not($naming-property/@mandatory='true')">
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift <xsl:message terminate="yes">
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift <xsl:value-of
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift select="concat('Relation ', ../@name,
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift ' references the naming property ',
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift $naming-property-name, ' in ',
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift $managed-object/@name, ' which is not mandatory. ',
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift 'Naming properties must be mandatory.')" />
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift </xsl:message>
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift </xsl:if>
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift <xsl:if test="$naming-property/@multi-valued='true'">
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift <xsl:message terminate="yes">
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift <xsl:value-of
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift select="concat('Relation ', ../@name,
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift ' references the naming property ',
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift $naming-property-name, ' in ',
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift $managed-object/@name, ' which is multi-valued. ',
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift 'Naming properties must be single-valued.')" />
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift </xsl:message>
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift </xsl:if>
c9020c301eada7085bb81da1821cac5533a1f20fmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy-of select="@*" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Add missing plural name attribute if not present.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:if test="not(@plural-name)">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:attribute name="plural-name">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$managed-object/@plural-name" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:attribute>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:if>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates mode="merge-relation">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="managed-object" select="$managed-object" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:copy>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Process a rich-description element in a relation.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:template match="adm:synopsis|adm:description"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift mode="merge-relation">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="managed-object" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Shallow copy.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy-of select="@*" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates mode="rich-description">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="ufn">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:call-template name="name-to-ufn">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="value" select="$managed-object/@name" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:call-template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:with-param>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="ufpn">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:call-template name="name-to-ufn">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="value"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="$managed-object/@plural-name" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:call-template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:with-param>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:copy>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Process a rich-description element.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:template
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift match="adm:synopsis|adm:description|adm:unit-description"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift mode="pre-process">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Shallow copy.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy-of select="@*" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates mode="rich-description">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="ufn" select="$this-ufn" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="ufpn" select="$this-ufpn" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:copy>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:template>
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift <!--
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift Process a relative inherited default behavior
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift -->
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift <xsl:template match="adm:relative" mode="pre-process">
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift <xsl:param name="mopackage" select="/.." />
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift <xsl:param name="moname" select="/.." />
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift <xsl:param name="hierarchy" select="/.." />
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift <xsl:copy>
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift <!--
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift Shallow copy.
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift -->
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift <xsl:copy-of select="@*" />
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift <!--
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift Add missing attribute managed-object-package if it is not provided.
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift -->
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift <xsl:if test="not(@managed-object-package)">
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift <xsl:attribute name="managed-object-package">
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift <xsl:value-of select="$mopackage" />
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift </xsl:attribute>
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift </xsl:if>
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift <!--
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift Apply templates to subordinate elements.
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift -->
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift <xsl:apply-templates mode="pre-process">
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift <xsl:with-param name="mopackage" select="$mopackage" />
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift <xsl:with-param name="moname" select="$moname" />
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift </xsl:apply-templates>
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift </xsl:copy>
e32b0f1464ea290b749a43d5ee7a6085b14532c9matthew_swift </xsl:template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Process a user-friendly-name element.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:template match="adm:user-friendly-name"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift mode="rich-description">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="ufn" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$ufn" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Process a user-friendly-plural-name element.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:template match="adm:user-friendly-plural-name"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift mode="rich-description">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="ufpn" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$ufpn" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Process a product-name element.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:template match="adm:product-name" mode="rich-description">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$product-name" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Default template for rich descriptions.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:template match="*|comment()" mode="rich-description">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="ufn" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="ufpn" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy-of select="@*" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates mode="rich-description">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="ufn" select="$ufn" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="ufpn" select="$ufpn" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:copy>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Default template for pre-processing.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:template match="*|comment()" mode="pre-process">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="mopackage" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="moname" select="/.." />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:param name="hierarchy" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy-of select="@*" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:apply-templates mode="pre-process">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="mopackage" select="$mopackage" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="moname" select="$moname" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="hierarchy" select="$hierarchy" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:apply-templates>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:copy>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Useful variables relating to the current managed object.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Product name.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift FIXME: should get this from the root configuration but for some
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift reason we get a circular dependency error when constructing
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift the URI in JDK1.6.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
ff2835d14868672e6192c19f768bceda1a7b635cludo <xsl:variable name="product-name" select="'OpenDJ'" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="this-name">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:when test="/adm:managed-object">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="/adm:managed-object/@name" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:when>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Must be the root configuration.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="'root'" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:variable>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="this-plural-name">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:when test="/adm:managed-object">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="/adm:managed-object/@plural-name" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:when>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Must be the root configuration - the plural form should never
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift be required as this is a singleton. We'll define it for
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift consistency.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="'roots'" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:variable>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="this-ufn">
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift <xsl:choose>
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift <xsl:when test="/adm:managed-object/adm:user-friendly-name">
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift <xsl:value-of
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift select="normalize-space(/adm:managed-object/adm:user-friendly-name)" />
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift </xsl:when>
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift <xsl:otherwise>
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift <xsl:call-template name="name-to-ufn">
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift <xsl:with-param name="value" select="$this-name" />
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift </xsl:call-template>
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift </xsl:otherwise>
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift </xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:variable>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="this-ufpn">
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift <xsl:choose>
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift <xsl:when
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift test="/adm:managed-object/adm:user-friendly-plural-name">
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift <xsl:value-of
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift select="normalize-space(/adm:managed-object/adm:user-friendly-plural-name)" />
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift </xsl:when>
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift <xsl:otherwise>
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift <xsl:call-template name="name-to-ufn">
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift <xsl:with-param name="value" select="$this-plural-name" />
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift </xsl:call-template>
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift </xsl:otherwise>
2e334e4f58d7760ed0788f5db5524d87934d6869matthew_swift </xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:variable>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="_this">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:call-template name="pre-process-managed-object" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:variable>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="_this_tmp" select="exsl:node-set($_this)" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="this"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="$_this_tmp/adm:managed-object | $_this_tmp/adm:root-managed-object" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="this-is-abstract"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="boolean(string($this/@abstract) = 'true')" />
9355c1819517672f3cfe09356402fe0257c96facmatthew_swift <xsl:variable name="this-is-advanced"
9355c1819517672f3cfe09356402fe0257c96facmatthew_swift select="boolean(string($this/@advanced) = 'true')" />
9355c1819517672f3cfe09356402fe0257c96facmatthew_swift <xsl:variable name="this-is-hidden"
9355c1819517672f3cfe09356402fe0257c96facmatthew_swift select="boolean(string($this/@hidden) = 'true')" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="this-is-root"
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift select="not(local-name($this) = 'managed-object')" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="this-package">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:when test="not($this-is-root)">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$this/@package" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:when>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="'org.opends.server.admin.std'" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:variable>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="this-java-class">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:call-template name="name-to-java">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="value" select="$this-name" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:call-template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:variable>
708d35fe04f46d93eac252569e7ca46b54194b08matthew_swift <xsl:variable name="_top-name"
708d35fe04f46d93eac252569e7ca46b54194b08matthew_swift select="$this/adm:profile[@name='preprocessor']/admpp:parent-managed-object[last()]/@name" />
708d35fe04f46d93eac252569e7ca46b54194b08matthew_swift <xsl:variable name="_top-length" select="string-length($_top-name)" />
708d35fe04f46d93eac252569e7ca46b54194b08matthew_swift <xsl:variable name="_this-length" select="string-length($this-name)" />
708d35fe04f46d93eac252569e7ca46b54194b08matthew_swift <xsl:variable name="_diff" select="$_this-length - $_top-length" />
708d35fe04f46d93eac252569e7ca46b54194b08matthew_swift <xsl:variable name="_start"
708d35fe04f46d93eac252569e7ca46b54194b08matthew_swift select="substring($this-name, 1, $_diff - 1)" />
708d35fe04f46d93eac252569e7ca46b54194b08matthew_swift <xsl:variable name="_middle"
708d35fe04f46d93eac252569e7ca46b54194b08matthew_swift select="substring($this-name, $_diff, 1)" />
708d35fe04f46d93eac252569e7ca46b54194b08matthew_swift <xsl:variable name="_end"
708d35fe04f46d93eac252569e7ca46b54194b08matthew_swift select="substring($this-name, $_diff + 1, $_top-length)" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="this-short-name">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:when test="$this-is-root">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="''" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:when>
708d35fe04f46d93eac252569e7ca46b54194b08matthew_swift <xsl:when test="not($_top-name)">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="''" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:when>
48224cd6d19e80b2152d9d0d8b830b6b15542fc1matthew <xsl:when test="$_middle != '-' or $_end != $_top-name">
48224cd6d19e80b2152d9d0d8b830b6b15542fc1matthew <!--
48224cd6d19e80b2152d9d0d8b830b6b15542fc1matthew <xsl:message terminate="no">
48224cd6d19e80b2152d9d0d8b830b6b15542fc1matthew <xsl:value-of
48224cd6d19e80b2152d9d0d8b830b6b15542fc1matthew select="concat('The managed object ', $this-name, ' should end with ', $_top-name)" />
48224cd6d19e80b2152d9d0d8b830b6b15542fc1matthew </xsl:message>
48224cd6d19e80b2152d9d0d8b830b6b15542fc1matthew -->
48224cd6d19e80b2152d9d0d8b830b6b15542fc1matthew <xsl:value-of select="$this-name" />
48224cd6d19e80b2152d9d0d8b830b6b15542fc1matthew </xsl:when>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:otherwise>
708d35fe04f46d93eac252569e7ca46b54194b08matthew_swift <xsl:value-of select="$_start" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:variable>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="this-short-java-class">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:call-template name="name-to-java">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="value" select="$this-short-name" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:call-template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:variable>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Useful variables relating to the parent managed object.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="parent-name" select="$this/@extends" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="parent-package">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:when test="$this/@parent-package">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$this/@parent-package" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:when>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:value-of select="$this-package" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:otherwise>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:choose>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:variable>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="parent-java-class">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:call-template name="name-to-java">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:with-param name="value" select="$parent-name" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:call-template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:variable>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Useful variables relating to managed object's relations.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="this-local-relations"
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift select="$this/adm:relation[adm:profile[@name='preprocessor']/admpp:last-defined-in[@name=$this-name and @package=$this-package]]" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="this-inherited-relations"
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift select="$this/adm:relation[adm:profile[@name='preprocessor']/admpp:last-defined-in[not(@name=$this-name and @package=$this-package)]]" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="this-all-relations" select="$this/adm:relation" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Useful variables relating to managed object's properties.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="this-local-properties"
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift select="$this/adm:property[adm:profile[@name='preprocessor']/admpp:last-defined-in[@name=$this-name and @package=$this-package]]" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="this-inherited-properties"
2fd21f254f199cb71616161617c667252fe4e7e3matthew_swift select="$this/adm:property[adm:profile[@name='preprocessor']/admpp:last-defined-in[not(@name=$this-name and @package=$this-package)]]" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:variable name="this-all-properties" select="$this/adm:property" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <!--
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift Default rule for testing.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift -->
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:template match="/">
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift <xsl:copy-of select="$this" />
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift </xsl:template>
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift</xsl:stylesheet>