Update xalan. Extend mergesysdef to handle merging pkgdefs with relative paths (in some cases). HighFidelityModel
authorBob Rosenberg <bob.rosenberg@nokia.com>
Tue, 13 Jul 2010 16:51:36 +0100
branchHighFidelityModel
changeset 336 fad9aea73cac
parent 335 633f3bea9521
child 338 d6135f9653cf
Update xalan. Extend mergesysdef to handle merging pkgdefs with relative paths (in some cases).
symbian4/app/calendarwidget/package_definition.xml
sysdeftools/LICENSE.xalan
sysdeftools/mergesysdef-module.xsl
sysdeftools/mergesysdef.xsl
sysdeftools/serializer.jar
sysdeftools/xalan.jar
sysdeftools/xercesImpl.jar
sysdeftools/xml-apis.jar
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/symbian4/app/calendarwidget/package_definition.xml	Tue Jul 13 16:51:36 2010 +0100
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<SystemDefinition schema="3.0.0" xmlns:qt="http://www.nokia.com/qt">
+   <package id="calendarwidget" name="Calendar Widget" levels="build app">
+    <collection id="calendarwidget_info" name="Calendar Widget Info" level="build">
+     <component id="calendarwidget_rom" name="Calendar Widget ROM" filter="dfs_build" introduced="^4">
+		<!-- remove subdirs and put exports into a real bld.inf  -->
+      <unit bldFile="." qt:proFile="calendarwidget.pro" qt:qmakeArgs="-r"/>
+     </component>
+    </collection>
+    <collection id="calendarwidgetinstaller" name="Calendar Widget Installer" level="build">
+		<!-- collection is really a component, need to move down a directory -->
+     <component id="calendarwidgetinstaller_build" name="Calendar Widget Installer Build" filter="dfs_build" introduced="^4">
+      <!--  built by calendarwidget_rom
+	  <unit bldFile="calendarwidgetinstaller" qt:qmakeArgs="-r" qt:proFile="calendarwidgetinstaller.pro"/> -->
+     </component>
+    </collection>
+    <collection id="calendarwidgetplugin" name="Calendar Widget Plugin" level="app">
+		<!-- collection is really a component, need to move down a directory -->
+     <component id="calendarwidgetplugin_build" name="Calendar Widget Plugin Build" filter="dfs_build" introduced="^4" class="plugin">
+      <!--  built by calendarwidget_rom
+	  <unit bldFile="calendarwidgetplugin" qt:qmakeArgs="-r" qt:proFile="calendarwidgetplugin.pro"/> -->
+     </component>
+     <component id="calendarwidgetplugin_test" name="Calendar Widget Plugin Test" filter="dfs_build" introduced="^4">
+      <unit bldFile="calendarwidgetplugin/tsrc" qt:qmakeArgs="-r" qt:proFile="tsrc.pro"/>
+     </component>
+    </collection>
+   </package>
+</SystemDefinition>
--- a/sysdeftools/LICENSE.xalan	Tue Jul 13 16:47:42 2010 +0100
+++ b/sysdeftools/LICENSE.xalan	Tue Jul 13 16:51:36 2010 +0100
@@ -23,7 +23,7 @@
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
  *
- * 4. The names "Xalan" and "Apache Software Foundation" must
+ * 4. The names "Xalan", "Xerces", and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
  *    software without prior written permission. For written 
  *    permission, please contact apache@apache.org.
@@ -48,8 +48,8 @@
  *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com.  For more
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.apache.org.  For more
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
  */
--- a/sysdeftools/mergesysdef-module.xsl	Tue Jul 13 16:47:42 2010 +0100
+++ b/sysdeftools/mergesysdef-module.xsl	Tue Jul 13 16:51:36 2010 +0100
@@ -368,7 +368,6 @@
 	<xsl:param name="down"/>
 	<xsl:param name="replaces"/>
 	<xsl:variable name="this" select="."/>	<!-- current item -->
-
 	<!-- match = this item in the downstream model -->	
 	<xsl:variable name="match" select="$other/*[@id=current()/@id]"/>
 
@@ -570,7 +569,6 @@
 	<xsl:param name="remove-before" select="0"/> <!-- set to true if any before attribute is to be removed -->
 	<xsl:param name="origin"/>	<!--the element containing the @name to use the origin-model attribute  -->
 	<xsl:param name="root"/> 	<!--the systemModel element in the upstream doc  -->
-
 	<xsl:choose>
 		<!-- this might slow things down, consider making optional -->
 		<xsl:when test="$root/descendant::collection[@id!=current()/../@id]/component[@id=current()/@id]">
@@ -592,10 +590,65 @@
 						<xsl:copy-of select="$origin/@root"/>
 					</xsl:if>
 				</xsl:if>
-				<xsl:copy-of select="*|comment()"/>
+				<xsl:apply-templates select="*|comment()" mode="merge-copy-of">
+					<xsl:with-param name="origin" select="$origin"/>
+					<xsl:with-param name="root" select="$root"/>
+				</xsl:apply-templates>
 			</xsl:copy>
 		</xsl:otherwise>
 	</xsl:choose>
 </xsl:template>
 
+
+<xsl:template match="unit" mode="merge-copy-of">
+	<xsl:param name="origin"/>	<!--the element containing the @name to use the origin-model attribute  -->
+	<xsl:param name="root"/> 	<!--the systemModel element in the upstream doc  -->
+	<xsl:copy>
+				<xsl:apply-templates select="@*" mode="merge-copy-of">
+					<xsl:with-param name="origin" select="$origin"/>
+					<xsl:with-param name="root" select="$root"/>
+				</xsl:apply-templates>
+	</xsl:copy>
+</xsl:template>
+
+
+
+<xsl:template match="unit/@bldFile | unit/@mrp | unit/@bldfile" mode="merge-copy-of">
+	<xsl:param name="origin" select="/.."/>	<!--the element containing the @name to use the origin-model attribute  -->
+
+	<xsl:attribute name="{name()}">
+		<xsl:choose>
+			<xsl:when test="not($origin/@pathto)"><xsl:value-of select="."/></xsl:when>
+			<xsl:when test="(contains(.,'://') and not(contains(substring-before(.,'://'),'/'))) or starts-with(.,'/')"> <!-- absolute URI or absolute path-->
+				<xsl:value-of select="."/>
+			</xsl:when>
+			<xsl:when test="contains($origin/@pathto,'://') and not(contains(substring-before($origin/@pathto,'://'),'/'))"> <!-- absolute URI for downstream sysdef not valif for unit paths, just copy and raise warning-->
+				<xsl:message>ERROR: Could not resolve relative path in downstream file: <xsl:value-of select="."/> relative to absolute URI <xsl:value-of select="$origin/@pathto"/></xsl:message>
+				<xsl:value-of select="."/>
+			</xsl:when>
+		<xsl:otherwise> <!-- relative link -->
+			<xsl:call-template name="lastbefore">
+				<xsl:with-param name="string" select="$origin/@pathto"/>
+			</xsl:call-template>/<xsl:value-of select="."/>
+		</xsl:otherwise>
+		</xsl:choose>
+	</xsl:attribute>
+</xsl:template>
+
+
+<!-- path handling follows -->
+
+ <xsl:template name="lastbefore"><xsl:param name="string"/><xsl:param name="substr" select="'/'"/>
+        <xsl:if test="contains($string,$substr)">
+                <xsl:value-of select="substring-before($string,$substr)"/>
+                <xsl:if test="contains(substring-after($string,$substr),$substr)">
+	                <xsl:value-of select="$substr"/>
+	              </xsl:if>
+        <xsl:call-template name="lastbefore">
+                <xsl:with-param name="string" select="substring-after($string,$substr)"/>
+                <xsl:with-param name="substr" select="$substr"/>
+        </xsl:call-template>
+        </xsl:if>
+</xsl:template>
+
 </xsl:stylesheet>
--- a/sysdeftools/mergesysdef.xsl	Tue Jul 13 16:47:42 2010 +0100
+++ b/sysdeftools/mergesysdef.xsl	Tue Jul 13 16:51:36 2010 +0100
@@ -1,4 +1,4 @@
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exslt="http://exslt.org/common">
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exslt="http://exslt.org/common" exclude-result-prefixes="exslt">
 <!--Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
 	All rights reserved.
 	This component and the accompanying materials are made available
@@ -100,7 +100,7 @@
 		<sysdef name="{$upname}"/>
 	</xsl:variable>
 	<xsl:variable name="downmodel">
-		<sysdef name="{$downname}"/>
+		<sysdef name="{$downname}" pathto="{$Downstream}"/>
 	</xsl:variable>
 	
 	<xsl:choose>
Binary file sysdeftools/serializer.jar has changed
Binary file sysdeftools/xalan.jar has changed
Binary file sysdeftools/xercesImpl.jar has changed
Binary file sysdeftools/xml-apis.jar has changed