sysmodelgen/core/mergesysdef.xsl
author Simon Howkins <simonh@symbian.org>
Thu, 25 Nov 2010 11:04:05 +0000
branchHighFidelityModel
changeset 509 a2fa088cf4dd
parent 432 0f44a943faf9
permissions -rw-r--r--
Changed to avoid bld.inf's being included more than once in conversations package
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
432
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
     1
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exslt="http://exslt.org/common" exclude-result-prefixes="exslt">
152
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     2
<!--Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     3
	All rights reserved.
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     4
	This component and the accompanying materials are made available
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     5
	under the terms of the License "Eclipse Public License v1.0"
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     6
	which accompanies this distribution, and is available
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     7
	at the URL "http://www.eclipse.org/legal/epl-v10.html".
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     8
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     9
	Initial Contributors:
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    10
	Nokia Corporation - initial contribution.
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    11
	Contributors:
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    12
	Description:
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    13
	Merge two 3.x syntax system definitions
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    14
-->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    15
432
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    16
<!--Description:This merges two 3.x syntax system definitions.
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    17
It can process two standalone sysdefs or two sysdef fragments which describe
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    18
the same system model item.
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    19
If the sysdefs are not the same schema, the output will use the highest schema
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    20
value of the two.
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    21
-->
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    22
<!--Input:<sysdef> - (required) The system definition XML file to process in the 3.0 format, and can be a fragment or stand-alone.
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    23
	If a fragment, this must be the same rank as the Downstream sysdef-->
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    24
<!--Output:<sysdef> - (optional) The system definition XML file to save the output as. If not present it will write to stdout.-->
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    25
152
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    26
	<xsl:output method="xml" indent="yes"/>
432
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    27
	<xsl:param name="Downstream">mcl/System_Definition_Template.xml</xsl:param> <!-- <sysdef> - (required) The path to the downstream systef relative to the upstream one (ie the -in sysdef). -->
152
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    28
	<xsl:key name="origin" match="component" use="@origin-model"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    29
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    30
<xsl:variable name="downstream" select="document($Downstream,.)/SystemDefinition"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    31
<xsl:param name="upname">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    32
	<xsl:choose>
165
ba562c1e2717 Using a dictionary no longer looks in meta sections. New argument -ignore-meta to ignore specific meta types. New xslt-param pkgAuxWidth to leave extra space on the right of packages. Fix for spanned layer height bug. Fix for namespace bug when joining. Support for drawing multiple sysdef fragments of the same rank.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 152
diff changeset
    33
		<xsl:when test="$downstream[starts-with(@schema,'2.') or starts-with(@schema,'1.')]">
152
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    34
			<xsl:message terminate="yes">Syntax <xsl:value-of select="@schema"/> not supported</xsl:message>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    35
		</xsl:when>
165
ba562c1e2717 Using a dictionary no longer looks in meta sections. New argument -ignore-meta to ignore specific meta types. New xslt-param pkgAuxWidth to leave extra space on the right of packages. Fix for spanned layer height bug. Fix for namespace bug when joining. Support for drawing multiple sysdef fragments of the same rank.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 152
diff changeset
    36
		<xsl:when test="name($downstream/*)!=name(/SystemDefinition/*)">
ba562c1e2717 Using a dictionary no longer looks in meta sections. New argument -ignore-meta to ignore specific meta types. New xslt-param pkgAuxWidth to leave extra space on the right of packages. Fix for spanned layer height bug. Fix for namespace bug when joining. Support for drawing multiple sysdef fragments of the same rank.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 152
diff changeset
    37
			<xsl:message terminate="yes">Can only merge fragments of the same rank</xsl:message>
ba562c1e2717 Using a dictionary no longer looks in meta sections. New argument -ignore-meta to ignore specific meta types. New xslt-param pkgAuxWidth to leave extra space on the right of packages. Fix for spanned layer height bug. Fix for namespace bug when joining. Support for drawing multiple sysdef fragments of the same rank.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 152
diff changeset
    38
		</xsl:when>
ba562c1e2717 Using a dictionary no longer looks in meta sections. New argument -ignore-meta to ignore specific meta types. New xslt-param pkgAuxWidth to leave extra space on the right of packages. Fix for spanned layer height bug. Fix for namespace bug when joining. Support for drawing multiple sysdef fragments of the same rank.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 152
diff changeset
    39
<!--		<xsl:when test="$downstream[not(systemModel)]">
ba562c1e2717 Using a dictionary no longer looks in meta sections. New argument -ignore-meta to ignore specific meta types. New xslt-param pkgAuxWidth to leave extra space on the right of packages. Fix for spanned layer height bug. Fix for namespace bug when joining. Support for drawing multiple sysdef fragments of the same rank.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 152
diff changeset
    40
			<xsl:message terminate="yes">Needs to be a standalone system definition</xsl:message>
ba562c1e2717 Using a dictionary no longer looks in meta sections. New argument -ignore-meta to ignore specific meta types. New xslt-param pkgAuxWidth to leave extra space on the right of packages. Fix for spanned layer height bug. Fix for namespace bug when joining. Support for drawing multiple sysdef fragments of the same rank.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 152
diff changeset
    41
		</xsl:when>-->
ba562c1e2717 Using a dictionary no longer looks in meta sections. New argument -ignore-meta to ignore specific meta types. New xslt-param pkgAuxWidth to leave extra space on the right of packages. Fix for spanned layer height bug. Fix for namespace bug when joining. Support for drawing multiple sysdef fragments of the same rank.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 152
diff changeset
    42
		<xsl:when test="/SystemDefinition/systemModel/@name=$downstream/systemModel/@name or not(/SystemDefinition/systemModel/@name)">
152
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    43
			<xsl:apply-templates mode="origin-term" select="/*">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    44
				<xsl:with-param name="root">Upstream</xsl:with-param>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    45
			</xsl:apply-templates>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    46
			</xsl:when>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    47
		<xsl:otherwise><xsl:value-of select="/SystemDefinition/systemModel/@name"/></xsl:otherwise>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    48
	</xsl:choose>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    49
</xsl:param>
432
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    50
<!-- [name] - (optional) The name used in the origin-model attribute of any component that comes from the upstream sysdef. Defaults to the name attribute on the systemModel element, or "Upstream"-->
152
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    51
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    52
<xsl:param name="downname">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    53
	<xsl:choose>
165
ba562c1e2717 Using a dictionary no longer looks in meta sections. New argument -ignore-meta to ignore specific meta types. New xslt-param pkgAuxWidth to leave extra space on the right of packages. Fix for spanned layer height bug. Fix for namespace bug when joining. Support for drawing multiple sysdef fragments of the same rank.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 152
diff changeset
    54
		<xsl:when test="/SystemDefinition/systemModel/@name=$downstream/systemModel/@name or not($downstream/systemModel/@name)">
152
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    55
			<xsl:apply-templates mode="origin-term" select="$downstream">	
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    56
				<xsl:with-param name="root">Downstream</xsl:with-param>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    57
			</xsl:apply-templates>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    58
			</xsl:when>
165
ba562c1e2717 Using a dictionary no longer looks in meta sections. New argument -ignore-meta to ignore specific meta types. New xslt-param pkgAuxWidth to leave extra space on the right of packages. Fix for spanned layer height bug. Fix for namespace bug when joining. Support for drawing multiple sysdef fragments of the same rank.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 152
diff changeset
    59
		<xsl:when test="name($downstream/*)!=name(/SystemDefinition/*)">
ba562c1e2717 Using a dictionary no longer looks in meta sections. New argument -ignore-meta to ignore specific meta types. New xslt-param pkgAuxWidth to leave extra space on the right of packages. Fix for spanned layer height bug. Fix for namespace bug when joining. Support for drawing multiple sysdef fragments of the same rank.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 152
diff changeset
    60
			<xsl:message terminate="yes">Can only merge fragments of the same rank</xsl:message>
ba562c1e2717 Using a dictionary no longer looks in meta sections. New argument -ignore-meta to ignore specific meta types. New xslt-param pkgAuxWidth to leave extra space on the right of packages. Fix for spanned layer height bug. Fix for namespace bug when joining. Support for drawing multiple sysdef fragments of the same rank.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 152
diff changeset
    61
		</xsl:when>
152
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    62
		<xsl:otherwise><xsl:value-of select="$downstream/systemModel/@name"/></xsl:otherwise>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    63
	</xsl:choose>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    64
</xsl:param>
432
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    65
<!-- [name] - (optional) The name used in the origin-model attribute of any component that comes from the downstream sysdef. Defaults to the name attribute on the systemModel element, or "Downstream"-->
152
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    66
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    67
<xsl:template mode="origin-term" match="*">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    68
	<xsl:param name="root"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    69
	<xsl:param name="index"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    70
	<xsl:choose>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    71
		<xsl:when test="not(key('origin',concat($root,$index)))">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    72
			<xsl:value-of select="concat($root,$index)"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    73
		</xsl:when>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    74
		<xsl:when test="$index=''">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    75
			<xsl:apply-templates mode="origin-term" select=".">	
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    76
				<xsl:with-param name="root" select="$root"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    77
				<xsl:with-param name="index" select="1"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    78
			</xsl:apply-templates>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    79
		</xsl:when>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    80
		<xsl:otherwise>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    81
			<xsl:apply-templates mode="origin-term" select=".">	
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    82
				<xsl:with-param name="root" select="$root"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    83
				<xsl:with-param name="index" select="$index + 1"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    84
			</xsl:apply-templates>		
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    85
		</xsl:otherwise>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    86
	</xsl:choose>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    87
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    88
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    89
432
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    90
<!-- choose the greater of the two versions -->
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    91
<xsl:template name="compare-versions"><xsl:param name="v1"/><xsl:param name="v2"/>
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    92
			<xsl:choose>
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    93
				<xsl:when test="$v1=$v2"><xsl:value-of select="$v1"/></xsl:when>
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    94
				<xsl:when test="substring-before($v1,'.') &gt; substring-before($v2,'.')"><xsl:value-of select="$v1"/></xsl:when>
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    95
				<xsl:when test="substring-before($v1,'.') &lt; substring-before($v2,'.')"><xsl:value-of select="$v2"/></xsl:when>
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    96
				<xsl:when test="substring-before(substring-after($v1,'.'),'.') &gt; substring-before(substring-after($v2,'.'),'.')"><xsl:value-of select="$v1"/></xsl:when>
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    97
				<xsl:when test="substring-before(substring-after($v1,'.'),'.') &lt; substring-before(substring-after($v2,'.'),'.')"><xsl:value-of select="$v2"/></xsl:when>
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    98
				<xsl:when test="substring-after(substring-after($v1,'.'),'.') &gt; substring-after(substring-after($v2,'.'),'.')"><xsl:value-of select="$v1"/></xsl:when>
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
    99
				<xsl:when test="substring-after(substring-after($v1,'.'),'.') &lt; substring-after(substring-after($v2,'.'),'.')"><xsl:value-of select="$v2"/></xsl:when>
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
   100
				<xsl:otherwise><xsl:value-of select="$v1"/></xsl:otherwise>
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
   101
			</xsl:choose>
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
   102
</xsl:template>
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
   103
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
   104
<!--  this merge only two files according to the 3.0.x rules. Old syntax not supported. Must be converetd before calling -->
152
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   105
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   106
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   107
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   108
<xsl:template match="/*">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   109
	<xsl:variable name="upmodel">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   110
		<sysdef name="{$upname}"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   111
	</xsl:variable>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   112
	<xsl:variable name="downmodel">
432
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
   113
		<sysdef name="{$downname}" pathto="{$Downstream}"/>
152
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   114
	</xsl:variable>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   115
	
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   116
	<xsl:choose>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   117
		<xsl:when test="function-available('exslt:node-set')">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   118
			<xsl:apply-templates mode="merge-models" select=".">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   119
				<xsl:with-param name="other" select="$downstream"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   120
				<xsl:with-param name="up" select="exslt:node-set($upmodel)/sysdef"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   121
				<xsl:with-param name="down" select="exslt:node-set($downmodel)/sysdef"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   122
			</xsl:apply-templates>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   123
		</xsl:when>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   124
		<xsl:otherwise> <!-- no node set funcion, so don't bother setting the names -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   125
			<xsl:apply-templates mode="merge-models" select=".">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   126
				<xsl:with-param name="other" select="$downstream"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   127
			</xsl:apply-templates> 		
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   128
		</xsl:otherwise>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   129
	</xsl:choose>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   130
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   131
432
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
   132
<xsl:include href="path-module.xsl"/>
152
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   133
<xsl:include href="mergesysdef-module.xsl"/>
432
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
   134
<xsl:template match="@*[local-name()='proFile' or local-name()='qmakeArgs'  or namespace-uri()='qt']" mode="merge-copy-of">
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
   135
	<!-- this fixes a xalan-j bug where it changes the namespace in the merged model to just "qt"-->
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
   136
	<xsl:attribute name="{local-name()}" namespace="http://www.nokia.com/qt">
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
   137
		<xsl:value-of select="."/>
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
   138
	</xsl:attribute>
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
   139
</xsl:template>
0f44a943faf9 System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 165
diff changeset
   140
152
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   141
</xsl:stylesheet>