diff options
author | Kurt Zenker <kz@openoffice.org> | 2004-05-19 12:49:25 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2004-05-19 12:49:25 +0000 |
commit | 4ae0aac56279a9dfc0804a36549990b442c91f0e (patch) | |
tree | 769f3e5e1381756c826bb35cee69fd745df31c9d /officecfg/util | |
parent | f2ab61275ad56abd535cec1249b78487cdeac97d (diff) |
INTEGRATION: CWS qwizards1 (1.7.164); FILE MERGED
2004/03/03 16:43:35 jb 1.7.164.1: #115775# Added support for node-ref instantiation of templates in the schema
Diffstat (limited to 'officecfg/util')
-rw-r--r-- | officecfg/util/alllang.xsl | 98 |
1 files changed, 65 insertions, 33 deletions
diff --git a/officecfg/util/alllang.xsl b/officecfg/util/alllang.xsl index b410a39428fc..981799a65095 100644 --- a/officecfg/util/alllang.xsl +++ b/officecfg/util/alllang.xsl @@ -3,9 +3,9 @@ * * $RCSfile: alllang.xsl,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: vg $ $Date: 2003-05-27 11:39:38 $ + * last change: $Author: kz $ $Date: 2004-05-19 13:49:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -141,48 +141,80 @@ <xsl:template match = "@oor:op" mode="locale"/> <!-- locale independent data --> + + <!-- handle template references --> + <xsl:template name="resolve-template-non-locale"> + <xsl:param name = "node-type"/> + <xsl:param name = "schema-type"/> + <xsl:param name = "component-schema"/> + + <xsl:choose> + <xsl:when test="$schema-type='node-ref'"> + <xsl:apply-templates select="." mode="non-locale"> + <xsl:with-param name="context" select="$component-schema/templates/*[@oor:name = $node-type]"/> + <xsl:with-param name="component-schema" select="$component-schema"/> + </xsl:apply-templates> + </xsl:when> + <xsl:when test="$schema-type='set'"> + <xsl:copy> + <xsl:apply-templates select = "@*" mode="non-locale"/> + <xsl:for-each select="node|prop"> + <xsl:apply-templates select="." mode="non-locale"> + <xsl:with-param name="context" select="$component-schema/templates/*[@oor:name = $node-type]"/> + <xsl:with-param name="component-schema" select="$component-schema"/> + </xsl:apply-templates> + </xsl:for-each> + </xsl:copy> + </xsl:when> + <xsl:otherwise> + <xsl:message terminate="true">ERROR: The schema element for a <xsl:value-of select="$schema-type"/> + should not have a node-type. + </xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + <xsl:template match="node" mode="non-locale"> <xsl:param name = "context"/> <xsl:param name = "component-schema"/> <xsl:if test="count(descendant::value[(not (@xml:lang)) or (@xml:lang=$fallback-locale)]) or count(descendant-or-self::*[(@oor:finalized='true') or (@oor:mandatory='true') or (@oor:op='replace') or (@oor:op='remove')])"> - <xsl:copy> - <xsl:apply-templates select = "@*" mode="non-locale"/> - <xsl:choose> - <!-- look for matching templates in other components --> - <xsl:when test="$context/@oor:node-type and $context/@oor:component"> - <xsl:variable name="fileURL"> - <xsl:call-template name="composeFileURL"> - <xsl:with-param name="component-schema" select="$component-schema"/> - <xsl:with-param name="componentName"><xsl:value-of select="$context/@oor:component"/></xsl:with-param> - </xsl:call-template> - </xsl:variable> - <xsl:for-each select="node|prop"> - <xsl:apply-templates select="." mode="non-locale"> - <xsl:with-param name="component-schema" select="$component-schema"/> - <xsl:with-param name="context" select="document($fileURL)/oor:component-schema/templates/*[@oor:name = $context/@oor:node-type]"/> - </xsl:apply-templates> - </xsl:for-each> - </xsl:when> - <!-- look for matching templates within the same component --> - <xsl:when test="$context/@oor:node-type"> - <xsl:for-each select="node|prop"> - <xsl:apply-templates select="." mode="non-locale"> - <xsl:with-param name="component-schema" select="$component-schema"/> - <xsl:with-param name="context" select="$component-schema/templates/*[@oor:name = $context/@oor:node-type]"/> - </xsl:apply-templates> - </xsl:for-each> - </xsl:when> - <xsl:otherwise> + <xsl:choose> + <!-- look for matching templates in other components --> + <xsl:when test="$context/@oor:node-type and $context/@oor:component"> + <xsl:variable name="fileURL"> + <xsl:call-template name="composeFileURL"> + <xsl:with-param name="component-schema" select="$component-schema"/> + <xsl:with-param name="componentName"><xsl:value-of select="$context/@oor:component"/></xsl:with-param> + </xsl:call-template> + </xsl:variable> + + <xsl:call-template name="resolve-template-non-locale"> + <xsl:with-param name="node-type" select="$context/@oor:node-type"/> + <xsl:with-param name="schema-type" select="local-name($context)"/> + <xsl:with-param name="component-schema" select="document($fileURL)/oor:component-schema"/> + </xsl:call-template> + </xsl:when> + <!-- look for matching templates within the same component --> + <xsl:when test="$context/@oor:node-type"> + <xsl:call-template name="resolve-template-non-locale"> + <xsl:with-param name="node-type" select="$context/@oor:node-type"/> + <xsl:with-param name="schema-type" select="local-name($context)"/> + <xsl:with-param name="component-schema" select="$component-schema"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:copy> + <xsl:apply-templates select = "@*" mode="non-locale"/> <xsl:for-each select="node|prop"> <xsl:apply-templates select="." mode="non-locale"> <xsl:with-param name="component-schema" select="$component-schema"/> <xsl:with-param name="context" select="$context/*[@oor:name = current()/@oor:name]"/> </xsl:apply-templates> </xsl:for-each> - </xsl:otherwise> - </xsl:choose> - </xsl:copy> + </xsl:copy> + </xsl:otherwise> + </xsl:choose> </xsl:if> </xsl:template> |