sysmodelgen/extra/validate-raw.xsl
author Bob Rosenberg <bob.rosenberg@nokia.com>
Tue, 28 Sep 2010 17:48:51 +0100
branchHighFidelityModel
changeset 432 0f44a943faf9
parent 152 5acf50bbb618
permissions -rw-r--r--
System model generator bug fixes for merging and dependencies. Support for 3.0.1 syntax. Catch up with sysdeftools.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
152
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     1
<stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform" 	xmlns:set="http://exslt.org/sets">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     2
<output method="text"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     3
<key name="name" match="component|collection|package|layer" use="@id"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     4
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     5
<template match="/*" priority="-1">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     6
ERROR: Invalid root element: <value-of select="name()"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     7
</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     8
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     9
<template match="*" priority="-5">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    10
ERROR: Invalid element: <value-of select="name()"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    11
</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    12
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    13
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    14
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    15
<template match="component/Build"/> <!-- for depmodel -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    16
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    17
<template match="@*" priority="-5">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    18
NOTE: unexpected attribute "<value-of select="name()"/>" on &lt;<value-of select="name(..)"/>&gt;</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    19
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    20
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    21
<template match="text()">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    22
<if test="normalize-space(.)!=''">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    23
ERROR: unexepected text: <value-of select="."/></if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    24
</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    25
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    26
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    27
<template match="/SystemDefinition">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    28
<if test="not(systemModel/@name)">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    29
Note: missing System Model name</if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    30
<for-each select="systemModel//*[@id]">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    31
	<if test="count(key('name',@id)) &gt; 1">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    32
ERROR: duplicate name for <value-of select="name()"/> "<value-of select="@id"/>" (<value-of select="count(key('name',@id))"/>)	<apply-templates mode="location" select=".."/></if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    33
</for-each>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    34
<apply-templates select="@schema | node()"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    35
<call-template name="extra-atts"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    36
<call-template name="extra-atts"><with-param name="item">collection</with-param></call-template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    37
<call-template name="extra-atts"><with-param name="item">package</with-param></call-template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    38
<call-template name="extra-atts"><with-param name="item">layer</with-param></call-template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    39
<variable name="levels">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    40
	<for-each select="set:distinct(//@level)">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    41
	   <value-of select="concat(.,' ')"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    42
   </for-each>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    43
  </variable>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    44
<if test="$levels!=''">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    45
Note: Level names used: <value-of select="normalize-space($levels)"/></if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    46
</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    47
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    48
<template name="extra-atts"><param name="item">component</param>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    49
<variable name="atts">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    50
	<for-each select="//*[name()=$item]/@*"><variable name="n" select="name()"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    51
	<if test="not(following::*[name()=$item]/@*[name()=$n])">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    52
	   <apply-templates mode="extra" select="."/></if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    53
	</for-each>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    54
</variable>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    55
<if test="$atts!=''">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    56
Note: Extra <value-of select="$item"/> attributes: <value-of select="normalize-space($atts)"/></if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    57
</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    58
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    59
<template match="@*" mode="extra">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    60
	   <value-of select="concat(name(), ' ')"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    61
</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    62
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    63
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    64
<template match="collection/@level | package/@level | package/@span | layer/@span| layer/@levels | package/@levels | @name | @id | @before |component/@filter |component/@contract |component/@deprecated |component/@class |component/@introduced |component/@purpose|component/@target" mode="extra"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    65
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    66
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    67
<template match="/SystemDefinition/@schema">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    68
<choose>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    69
	<when test="starts-with(.,'3.')"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    70
<otherwise>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    71
ERROR: unsupported syntax: <value-of select="."/></otherwise>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    72
</choose>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    73
</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    74
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    75
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    76
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    77
<template match="@level">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    78
WARNING: invalid attribute "<value-of select="name()"/>" on &lt;<value-of select="name(..)"/>&gt;</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    79
	
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    80
<template match="systemModel/layer|layer/package|package/package| package/collection| collection/component |
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    81
	SystemDefinition/layer| SystemDefinition/package| SystemDefinition/collection| SystemDefinition/component">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    82
	<apply-templates select="@*|node()"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    83
</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    84
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    85
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    86
<template match="layer|package|collection|component" priority="-3">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    87
ERROR: &lt;<value-of select="name()"/> name="<value-of select="@id"/>"&gt; cannot be a child of &lt;<value-of select="name(..)"/>&gt;</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    88
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    89
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    90
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    91
<template match="package/@level">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    92
<if test="not(contains(concat(' ',normalize-space(../../@levels), ' '),concat(' ',normalize-space(.), ' ')))">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    93
ERROR: Invalid level name "<value-of select="."/>" on <value-of select="name(..)"/> "<value-of select="../@id"/>" (<value-of select="../../@levels"/>)</if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    94
</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    95
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    96
<template match="collection/@level">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    97
<choose>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    98
	<when test="ancestor::package/@levels">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    99
		<if test="not(contains(concat(' ',normalize-space(ancestor::package/@levels), ' '),concat(' ',normalize-space(.), ' ')))">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   100
ERROR: Invalid level name "<value-of select="."/>" on <value-of select="name(..)"/> "<value-of select="../@id"/>" (<value-of select="../../@levels"/>)</if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   101
	</when>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   102
	<otherwise>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   103
		<if test="not(contains(concat(' ',normalize-space(ancestor::layer/@levels), ' '),concat(' ',normalize-space(.), ' ')))">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   104
ERROR: Invalid level name "<value-of select="."/>" on <value-of select="name(..)"/> "<value-of select="../@id"/>" (<value-of select="../../@levels"/>)</if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   105
	</otherwise>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   106
</choose>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   107
</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   108
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   109
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   110
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   111
<template match="component/@plugin">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   112
	<if test=".!='Y' and .!='N'">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   113
WARNING: invalid <value-of select="name()"/> value "<value-of select="."/>" on &lt;<value-of select="name(..)"/> name="<value-of select="../@id"/>"&gt;</if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   114
</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   115
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   116
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   117
<template match="logicalset|logicalsubset|module|SystemBuild">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   118
ERROR: using 1.x syntax element: &lt;<value-of select="name()"/>&gt;</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   119
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   120
<template match="unit/@name | unit/@unitID">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   121
<if test="not(starts-with(/SystemDefinition/@schema,'1.'))">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   122
WARNING: using 1.x syntax attribute: &lt;<value-of select="concat(name(..),' ',name())"/>="<value-of select="."/>"&gt;</if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   123
</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   124
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   125
<template match="@name | layer/@levels |package/@levels | component/@class | component/@filter | component/@introduced  | component/@deprecated | component/@contract"> <!-- validate elsewhere -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   126
	<if test=".=''">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   127
ERROR: attribute "<value-of select="name()"/>" on &lt;<value-of select="name(..)"/>&gt; must not be empty</if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   128
</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   129
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   130
<template match="systemModel|meta">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   131
	<apply-templates select="@*|node()"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   132
</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   133
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   134
<template match="meta/*"/> <!-- anything's valid-->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   135
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   136
<template match="meta/@href | meta/@rel | meta/@type"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   137
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   138
<template match="unit[starts-with(/SystemDefinition/@schema,'1.')]/@contract"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   139
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   140
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   141
<template match="unit/@mrp | unit/@bldFile">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   142
<choose>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   143
<when test="starts-with(/SystemDefinition/@schema,'1.')">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   144
	<if test="contains(.,'/')">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   145
WARINING: path separator must be "\" for <value-of select="name()"/>="<value-of select="."/>"</if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   146
</when>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   147
<otherwise>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   148
	<if test="contains(.,'\')">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   149
WARINING: path separator must be "/" for <value-of select="name()"/>="<value-of select="."/>"</if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   150
</otherwise>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   151
</choose>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   152
</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   153
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   154
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   155
<template match="unit/@version | unit/@priority | unit/@filter | unit/@root"/> <!-- handle later-->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   156
<template match="package/@* | prebuilt/@*"/> <!-- handle later-->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   157
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   158
<template match="unit|component/package|prebuilt">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   159
	<if test="*">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   160
WARNING: &lt;<value-of select="name()"/>&gt; must be empty.</if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   161
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   162
<if test="not(starts-with(/SystemDefinition/@schema,'1.'))">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   163
<if test="count(../unit | ../package | ../prebuilt) != 1 and count(../*[@filter or @version]) != count(../*)">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   164
WARNING: multiple units must have "version" or "filter" attributes (<value-of select="../@id"/>)</if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   165
<if test="self::prebuilt or self::package">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   166
ERROR: using 1.x syntax element: &lt;<value-of select="name()"/>&gt;</if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   167
</if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   168
<apply-templates select="@*"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   169
</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   170
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   171
<template mode="location" match="*">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   172
<for-each select="ancestor::*[(self::layer or self::package or self::collection) and @name]">[<value-of select="substring(name(),1,1)"/>] <value-of select="@id"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   173
	<if test="position()=1"> / </if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   174
</for-each>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   175
</template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   176
</stylesheet>