<?xmlversion="1.0"encoding="utf-8"standalone="yes" ?> <!-- * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<!-- ****************************************** --> <!-- * handle template references *** --> <!-- ****************************************** -->
<xsl:template name="resolve-template">
<xsl:param name = "node-type"/>
<xsl:param name = "schema-type"/>
<xsl:param name = "component-schema"/>
<xsl:variable name = "path">
<xsl:call-template name="collectPath"/>
</xsl:variable>
<xsl:if test="not ($component-schema)">
<xsl:message terminate="yes">ERROR: Template '<xsl:value-of select="$node-type"/>',
referenced from node '<xsl:value-of select="$path"/>'
does not exist in schema!
</xsl:message>
</xsl:if>
<xsl:choose>
<xsl:when test="$schema-type='node-ref'">
<xsl:variable name="context" select="$component-schema/templates/*[@oor:name = $node-type]"/>
<xsl:apply-templates select=".">
<xsl:with-param name="context" select="$context"/>
<xsl:with-param name="component-schema" select="$component-schema"/>
<xsl:with-param name="parent-schema-type" select="local-name($context)"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$schema-type='set'">
<xsl:for-each select="node|prop">
<xsl:apply-templates select=".">
<xsl:with-param name="context" select="$component-schema/templates/*[@oor:name = $node-type]"/>
<xsl:with-param name="component-schema" select="$component-schema"/>
<xsl:with-param name="parent-schema-type" select="$schema-type"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">ERROR: The schema element for node <xsl:value-of select="$path"/>
is a <xsl:value-of select="$schema-type"/> and should not have a node-type.
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ****************************************** --> <!-- * node *** --> <!-- ****************************************** -->
<xsl:template match="node">
<xsl:param name = "context"/>
<xsl:param name = "component-schema"/>
<xsl:param name = "parent-schema-type"/>
<xsl:variable name = "path">
<xsl:call-template name="collectPath"/>
</xsl:variable>
<xsl:if test="not ($context)">
<xsl:message terminate="yes">ERROR: Node '<xsl:value-of select="$path"/>' does not exist in schema!</xsl:message>
</xsl:if>
<xsl:if test="@oor:mandatory='true' and $parent-schema-type!='set'">
<xsl:message terminate="yes">ERROR: Node '<xsl:value-of select="$path"/>' that is not a set element is marked as mandatory!</xsl:message>
</xsl:if>
</xsl:template>
<xsl:if test="not ($context)">
<xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' does not exist in schema !</xsl:message>
</xsl:if>
<!-- ****************************************** --> <!-- * value *** --> <!-- ****************************************** -->
<xsl:template match="value">
<xsl:call-template name="checkModule"/>
<xsl:variable name="path">
<xsl:call-template name="collectPath"/>
</xsl:variable>
<xsl:variable name="lang" select="@xml:lang"/>
<xsl:variable name="module" select="@install:module"/>
<xsl:if test="$module and $lang='x-no-translate'">
<xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' has value for special xml:lang="x-no-translate" in module <xsl:value-of select="$module"/>.</xsl:message>
</xsl:if>
<xsl:choose>
<xsl:when
test="preceding-sibling::value[($lang and not(@xml:lang)) or (not($lang) and @xml:lang)]">
<xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' has values with and without xml:lang attributes.</xsl:message>
</xsl:when>
<xsl:when
test="preceding-sibling::value[((not($lang) and not(@xml:lang)) or $lang=@xml:lang) and ((not($module) and not(@install:module)) or $module=@install:module)]">
<xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' has values with matching xml:lang attribute <xsl:value-of select="$lang"/> and inconsistent install:module attributes.</xsl:message>
</xsl:when>
</xsl:choose>
</xsl:template>
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.