More forgiving system model tools handing of xsltproc and levels in nested packages HighFidelityModel
authorBob Rosenberg <bob.rosenberg@nokia.com>
Thu, 13 May 2010 16:03:11 +0100
branchHighFidelityModel
changeset 207 2fd8a273d6d6
parent 206 eccc98839441
child 208 95cc05013e2e
More forgiving system model tools handing of xsltproc and levels in nested packages
sysmodelgen/core/draw-model.xsl
sysmodelgen/core/joinsysdef-module.xsl
--- a/sysmodelgen/core/draw-model.xsl	Thu May 13 15:57:44 2010 +0100
+++ b/sysmodelgen/core/draw-model.xsl	Thu May 13 16:03:11 2010 +0100
@@ -1029,6 +1029,20 @@
 	</xsl:if>
 </xsl:template>
 
+
+<xsl:template match="layer/package/package[@levels]" mode="levels" priority="1">
+<!-- a nested package with levels defined in the layer  -->
+	<xsl:call-template name="levels-list">
+		<xsl:with-param name="levels" select="normalize-space(@levels)"/>
+	</xsl:call-template>
+	<xsl:if test="descendant::collection[not(contains(concat(' ',normalize-space(current()/@levels),' '),@level)) or not(@level)]">
+		<!--<xsl:call-template name="Caller-Warning">
+			<xsl:with-param name="text">collection without valid level in package <xsl:value-of select="@id"/></xsl:with-param>
+		</xsl:call-template>-->	
+		<level/>
+	</xsl:if>
+</xsl:template>
+
 <xsl:template match="layer/package[@levels]/package" mode="levels" priority="1">
 	<!-- a package with levels and a nested pkg  -->
 	<xsl:call-template name="levels-list">
--- a/sysmodelgen/core/joinsysdef-module.xsl	Thu May 13 15:57:44 2010 +0100
+++ b/sysmodelgen/core/joinsysdef-module.xsl	Thu May 13 16:03:11 2010 +0100
@@ -128,7 +128,8 @@
 		reverse order so we can try to use the first namespace prefix defined if it's available-->
 	<xsl:for-each select="document(@href,.)/*">
 		<xsl:apply-templates select="//*[(self::component or self::collection or self::package or self::layer) and @href]" mode="scan-for-namespaces"/>
-		<xsl:for-each select="//namespace::* | @id-namespace">
+		<xsl:for-each select="//namespace::*[.!='http://www.w3.org/XML/1998/namespace'] | @id-namespace">
+			<!-- ignore XML namespace -->
 			<xsl:value-of select="concat(name(),' ',.,'&#xa;')"/>
 		</xsl:for-each>
 	</xsl:for-each>