sysmodellibs/sysmodelgen/core/joinmodel.xsl
changeset 7 3c36c452f013
equal deleted inserted replaced
6:5b32dc297d05 7:3c36c452f013
       
     1 <?xml version="1.0"?>
       
     2  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
       
     3 <!--Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 	All rights reserved.
       
     5 	This component and the accompanying materials are made available
       
     6 	under the terms of the License "Eclipse Public License v1.0"
       
     7 	which accompanies this distribution, and is available
       
     8 	at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     9 
       
    10 	Initial Contributors:
       
    11 	Nokia Corporation - initial contribution.
       
    12 	Contributors:
       
    13 	Description:
       
    14 	Create a stand-alone sysdef from a linked set of fragments
       
    15 -->
       
    16  	<xsl:output method="xml" indent="yes"/>
       
    17 <!-- create a stand-alone sysdef from a linked set of fragments -->
       
    18 
       
    19 <xsl:template match="/model">
       
    20 	<xsl:apply-templates select="sysdef[1]" mode="join-sysdef-from-model"/>
       
    21 </xsl:template>
       
    22 
       
    23 <xsl:template mode="join-sysdef-from-model" match="/model/sysdef">
       
    24 	<xsl:apply-templates select="document(@href,.)/*" mode="join">
       
    25 		<xsl:with-param name="filename">
       
    26 			<xsl:call-template name="lastbefore">
       
    27 				<xsl:with-param name="string">
       
    28 					<xsl:choose>
       
    29 						<xsl:when test="@path"><xsl:value-of select="@path"/></xsl:when>
       
    30 						<xsl:when test="@path-prefix and starts-with(@href,@path-prefix)"><xsl:value-of select="substring(@href,string-length(@path-prefix) + 1)"/></xsl:when>
       
    31 						<xsl:otherwise><xsl:value-of select="@href"/></xsl:otherwise>
       
    32 					</xsl:choose>								
       
    33 				</xsl:with-param>
       
    34 			</xsl:call-template>
       
    35 		</xsl:with-param>
       
    36 		<xsl:with-param name="data" select="current()"/>
       
    37 	</xsl:apply-templates>
       
    38 </xsl:template>
       
    39 
       
    40 
       
    41 <xsl:include href="joinsysdef-module.xsl"/>
       
    42 <xsl:include href="filtersysdef-module.xsl"/>
       
    43 <xsl:include href="overlay-module.xsl"/>
       
    44 
       
    45 </xsl:stylesheet>