sysmodellibs/sysmodelgen/extra/output-sysdef.xsl
changeset 7 3c36c452f013
parent 6 5b32dc297d05
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysmodellibs/sysmodelgen/extra/output-sysdef.xsl	Wed Oct 13 16:21:25 2010 +0100
@@ -0,0 +1,43 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+	<xsl:output method="xml" indent="yes"/>
+<!-- strip out build-related stuff and just leave the model + added attributes -->
+
+<xsl:param name="everything" select="1"/>
+
+<xsl:template match="@*">
+	<xsl:if test="$everything">
+		<xsl:copy-of select="."/>
+	</xsl:if>
+</xsl:template>
+
+
+<xsl:template match="unit|@id|@name|@href|@before|layer/@levels|package/@levels | layer/@span | package/@span |
+	package/@version | package/@tech-domain | @level | 
+	 component/@deprecated |   component/@introduced|   component/@target  |   component/@purpose |  component/@class |  component/@filter | component/@origin-model ">
+	<xsl:copy-of select="."/>
+</xsl:template>
+
+
+<xsl:template match="meta"/> <!-- should make conditional based on param -->
+
+<xsl:template match="layer|package|collection|component">
+	<xsl:copy>
+		<xsl:apply-templates select="@*"/>
+		<xsl:apply-templates select="*"/>
+	</xsl:copy>
+</xsl:template>
+
+<xsl:template match="SystemDefinition">
+	<xsl:copy><xsl:copy-of select="@schema|@id-namespace"/>
+		<xsl:apply-templates select="systemModel | layer | package | collection | component"/>
+	</xsl:copy>
+</xsl:template>
+
+<xsl:template match="systemModel">
+	<xsl:copy><xsl:copy-of select="@name"/>
+	<xsl:apply-templates select="layer|meta"/>
+	</xsl:copy>
+</xsl:template>
+
+
+</xsl:stylesheet>