sysmodellibs/sysmodelgen/src/svg/output-sysdef.xsl
changeset 1 b538b70cbe51
equal deleted inserted replaced
0:2e8eeb919028 1:b538b70cbe51
       
     1 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
       
     2 	<xsl:output method="xml" indent="yes"/>
       
     3 <!-- strip out build-related stuff and just leave the model + added attributes -->
       
     4 
       
     5 <xsl:template match="component|component/*">
       
     6 	<xsl:copy>
       
     7 		<xsl:apply-templates select="@*|node()"/>
       
     8 	</xsl:copy>
       
     9 </xsl:template>
       
    10 
       
    11 <xsl:template match="component/*/* | @*"> <!-- no rules, so just copy -->
       
    12 	<xsl:copy-of select="."/>
       
    13 </xsl:template>
       
    14 
       
    15 <xsl:template match="@mrp|@bldFile">
       
    16 	<xsl:attribute name="{name()}">
       
    17 		<xsl:value-of select="translate(.,'\','/')"/>
       
    18 	</xsl:attribute>
       
    19 </xsl:template>
       
    20 
       
    21 <xsl:template match="@schema[starts-with(.,'1.')]">
       
    22 	<xsl:attribute name="{name()}">2.0.0</xsl:attribute> <!-- upgrade syntax -->
       
    23 </xsl:template>
       
    24 
       
    25 <xsl:template match="@abbrev|@generator-border|@generator-overlay|@align"/>
       
    26 
       
    27 <xsl:template match="generator-color|generator-style|component/text()" priority="1"/>
       
    28 
       
    29 <xsl:template match="layer|block|subblock|collection">
       
    30 	<xsl:copy>
       
    31 		<xsl:apply-templates select="@*"/>
       
    32 		<xsl:apply-templates select="*"/>
       
    33 	</xsl:copy>
       
    34 </xsl:template>
       
    35 
       
    36 <xsl:template match="SystemDefinition">
       
    37 	<xsl:copy>
       
    38 		<xsl:apply-templates select="@name|@schema"/>
       
    39 		<xsl:apply-templates select="systemModel"/>
       
    40 	</xsl:copy>
       
    41 </xsl:template>
       
    42 
       
    43 <xsl:template match="systemModel">
       
    44 	<xsl:copy><xsl:apply-templates select="layer"/></xsl:copy>
       
    45 </xsl:template>
       
    46 
       
    47 
       
    48 </xsl:stylesheet>