author | Ross Qin <ross.qin@nokia.com> |
Tue, 30 Nov 2010 14:05:41 +0800 | |
changeset 713 | 7b7f0409fc00 |
parent 661 | 199bb033aacf |
child 663 | 8e27d440923e |
permissions | -rw-r--r-- |
624
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
1 |
<?xml version="1.0"?> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
2 |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
3 |
xmlns:exslt="http://exslt.org/common" exclude-result-prefixes="exslt"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
4 |
<!--Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
5 |
All rights reserved. |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
6 |
This component and the accompanying materials are made available |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
7 |
under the terms of the License "Eclipse Public License v1.0" |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
8 |
which accompanies this distribution, and is available |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
9 |
at the URL "http://www.eclipse.org/legal/epl-v10.html". |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
10 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
11 |
Initial Contributors: |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
12 |
Nokia Corporation - initial contribution. |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
13 |
Contributors: |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
14 |
Description: |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
15 |
XSLT module which contains the logic to join a system definition file |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
16 |
--> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
17 |
<!-- save SF namespace as a constant to avoid the risk of typos--> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
18 |
<xsl:variable name="defaultns">http://www.symbian.org/system-definition</xsl:variable> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
19 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
20 |
<!-- create a stand-alone sysdef from a linked set of fragments --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
21 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
22 |
<xsl:template match="/*" mode="join"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
23 |
<xsl:param name="filename"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
24 |
<xsl:message terminate="yes">ERROR: Cannot process this document<xsl:if test="$filename !=''"> (<xsl:value-of select="$filename"/>)</xsl:if> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
25 |
<xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
26 |
<xsl:when test="self::SystemDefinition/@schema">. Unrecognised syntax schema="<xsl:value-of select="@schema"/>"</xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
27 |
<xsl:when test="self::SystemDefinition">. Missing schema</xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
28 |
<xsl:otherwise>. Invalid file type: <xsl:value-of select="name()"/></xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
29 |
</xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
30 |
</xsl:message> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
31 |
</xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
32 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
33 |
<!-- anything in schemas 3.0.x won't add new functional attributes that need processing here, just blindly copy them--> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
34 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
35 |
<xsl:template match="/SystemDefinition[starts-with(@schema,'3.0.') and count(*)=1]" mode="join"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
36 |
<xsl:param name="origin" select="/.."/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
37 |
<xsl:param name="root"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
38 |
<xsl:param name="filename"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
39 |
<xsl:param name="namespaces"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
40 |
<xsl:param name="data" select="/.."/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
41 |
<xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
42 |
<xsl:when test="$origin"> <!-- this sysdef fragment was linked from a parent sysdef --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
43 |
<xsl:for-each select="*"> <!-- can be only one --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
44 |
<xsl:variable name="upid"><xsl:apply-templates select="$origin/@id" mode="my-id"/></xsl:variable> <!-- namespaceless ID of this in parent doc --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
45 |
<xsl:variable name="id"><xsl:apply-templates select="@id" mode="my-id"/></xsl:variable> <!-- namespaceless ID of this here --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
46 |
<xsl:variable name="upns"><xsl:apply-templates select="$origin/@id" mode="my-namespace"/></xsl:variable> <!-- ID's namespace in parent doc --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
47 |
<xsl:variable name="ns"><xsl:apply-templates select="@id" mode="my-namespace"/></xsl:variable> <!-- ID's namespace --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
48 |
<xsl:if test="$id!=$upid or $ns!=$upns"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
49 |
<xsl:message terminate="yes">ERROR: Linked ID "<xsl:value-of select="$id"/>" (<xsl:value-of select="$ns"/>) must match linking document "<xsl:value-of select="$upid"/>" (<xsl:value-of select="$upns"/>)</xsl:message> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
50 |
</xsl:if> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
51 |
<!-- copy any attributes not already defined (parent doc overrides child doc)--> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
52 |
<xsl:for-each select="@*"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
53 |
<xsl:variable name="n" select="name()"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
54 |
<xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
55 |
<xsl:when test="$n='id'"/> <!-- never copy this, always set --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
56 |
<xsl:when test="$origin/@*[name()=$n]"> <!-- don't copy if already set --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
57 |
<xsl:message>Note: Cannot set "<xsl:value-of select="$n"/>", already set on <xsl:value-of select="$origin/@id"/>. Ignoring linked value</xsl:message> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
58 |
</xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
59 |
<xsl:when test="$n='before' or $n='replace'"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
60 |
<!-- ensure ns is correct (if any future attribtues will ever use an ID, process it here too)--> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
61 |
<xsl:apply-templates select="." mode="join"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
62 |
<xsl:with-param name="namespaces" select="$namespaces"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
63 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
64 |
</xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
65 |
<xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise> <!-- just copy anything else --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
66 |
</xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
67 |
</xsl:for-each> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
68 |
<xsl:copy-of select="../namespace::*[not(.=$namespaces)]"/> <!-- set any namespaces not already set (they should all alreayd be, but some XSLT processors are quirky) --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
69 |
<xsl:apply-templates select="$data" mode="overlay-attributes"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
70 |
<xsl:with-param name="item" select="current()"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
71 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
72 |
<xsl:variable name="content"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
73 |
<xsl:apply-templates select="*|comment()" mode="join"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
74 |
<xsl:with-param name="root" select="$root"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
75 |
<xsl:with-param name="filename" select="$filename"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
76 |
<xsl:with-param name="data" select="$data"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
77 |
<xsl:with-param name="namespaces" select="$namespaces | ../namespace::*[not(.=$namespaces)]"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
78 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
79 |
</xsl:variable> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
80 |
<xsl:apply-templates select="." mode="is-content-filtered"> <!-- optionally add filtered="yes" if some content has been removed --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
81 |
<xsl:with-param name="content" select="$content"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
82 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
83 |
<xsl:apply-templates select="$data" mode="overlay-meta"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
84 |
<xsl:with-param name="item" select="current()"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
85 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
86 |
<xsl:copy-of select="$content"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
87 |
</xsl:for-each> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
88 |
</xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
89 |
<xsl:when test="function-available('exslt:node-set')"> <!-- this is the root element of a root sysdef --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
90 |
<!--try to put all namespaces in root element --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
91 |
<xsl:variable name="nss"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
92 |
<!-- contains node set of namespaces to add to root element. |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
93 |
May panic if there are too many single-letter namespaces and this can't create a new one --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
94 |
<xsl:call-template name="needed-namespaces"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
95 |
<xsl:with-param name="foundns"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
96 |
<xsl:apply-templates select="//*[(self::component or self::collection or self::package or self::layer) and @href]" mode="scan-for-namespaces"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
97 |
</xsl:with-param> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
98 |
</xsl:call-template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
99 |
</xsl:variable> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
100 |
<xsl:variable name="ns" select="@id-namespace | namespace::* | exslt:node-set($nss)/*"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
101 |
<xsl:copy><xsl:copy-of select="@*[name()!='schema']"/><xsl:call-template name="set-schema"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
102 |
<xsl:apply-templates select="self::*[not(@id-namespace)]" mode="add-id-ns"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
103 |
<xsl:for-each select="exslt:node-set($nss)/*"> <!-- add namespace definitions --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
104 |
<xsl:attribute name="xmlns:{name()}"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
105 |
<xsl:value-of select="."/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
106 |
</xsl:attribute> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
107 |
</xsl:for-each> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
108 |
<!-- no need to call is-content-filtered, it never will be from this element --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
109 |
<xsl:apply-templates select="*|comment()" mode="join"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
110 |
<xsl:with-param name="namespaces" select="$ns"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
111 |
<xsl:with-param name="root" select="$root"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
112 |
<xsl:with-param name="data" select="$data"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
113 |
<xsl:with-param name="filename" select="$filename"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
114 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
115 |
</xsl:copy> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
116 |
</xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
117 |
<xsl:otherwise> <!-- can't handle node-set() so put the namespaces in the document instead of the root element--> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
118 |
<xsl:variable name="ns" select="@id-namespace | namespace::*"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
119 |
<xsl:copy><xsl:copy-of select="@*[name()!='schema']"/><xsl:call-template name="set-schema"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
120 |
<!-- no need to call is-content-filtered, it never will be from this element --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
121 |
<xsl:apply-templates select="*|comment()" mode="join"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
122 |
<xsl:with-param name="namespaces" select="$ns"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
123 |
<xsl:with-param name="root" select="$root"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
124 |
<xsl:with-param name="data" select="$data"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
125 |
<xsl:with-param name="filename" select="$filename"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
126 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
127 |
</xsl:copy> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
128 |
</xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
129 |
</xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
130 |
</xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
131 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
132 |
<xsl:template match="*" mode="scan-for-namespaces"/> <!-- just in case of errors, consider replacing by terminate --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
133 |
<xsl:template match="*[@href and not(self::meta)]" mode="scan-for-namespaces"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
134 |
<!-- produce a list of namespace-prefix namespace pairs separated by newlines, in reverse order found in documents |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
135 |
reverse order so we can try to use the first namespace prefix defined if it's available--> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
136 |
<xsl:variable name="linked" select="document(@href,.)/*"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
137 |
<xsl:for-each select="$linked"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
138 |
<xsl:apply-templates select="//*[(self::component or self::collection or self::package or self::layer) and @href]" mode="scan-for-namespaces"/> |
660
66ff3e731c60
Sysdeftools additional support for merging misordered system definitions. More extensive validation. Minor bug fixes. Bash wrappers for perl scripts for unix installs.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
639
diff
changeset
|
139 |
<xsl:for-each select="//namespace::*[.!='http://www.w3.org/XML/1998/namespace'] | @id-namespace"> |
66ff3e731c60
Sysdeftools additional support for merging misordered system definitions. More extensive validation. Minor bug fixes. Bash wrappers for perl scripts for unix installs.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
639
diff
changeset
|
140 |
<!-- ignore XML namespace --> |
624
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
141 |
<xsl:value-of select="concat(name(),' ',.,'
')"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
142 |
</xsl:for-each> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
143 |
</xsl:for-each> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
144 |
<xsl:if test="not($linked)"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
145 |
<xsl:message>Note: The link to <xsl:value-of select="@href"/> from <xsl:value-of select="concat(name(),' ',@id)"/> could not be resolved. Perhaps there's an error in the XML?</xsl:message> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
146 |
</xsl:if> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
147 |
</xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
148 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
149 |
<xsl:template name="needed-namespaces"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
150 |
<xsl:param name="foundns"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
151 |
<xsl:param name="usedpre"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
152 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
153 |
<xsl:if test="$foundns!=''"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
154 |
<xsl:variable name="line" select="substring-before($foundns,'
')"/> <!-- always has trailing newline --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
155 |
<xsl:variable name="name" select="substring-after($line,' ')"/> <!-- namespace prefix --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
156 |
<xsl:variable name="remainder" select="substring-after($foundns,'
')"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
157 |
<xsl:variable name="newprefix"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
158 |
<xsl:if test="not(contains(concat('
',$remainder),concat('
',$line,'
'))) and |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
159 |
not(//namespace::*[.=$name] or @id-namespace[.=$name] or (not(@id-namespace) and $defaultns=$name))"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
160 |
<xsl:apply-templates select="." mode="ns-prefix"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
161 |
<xsl:with-param name="ns" select="$name"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
162 |
<xsl:with-param name="pre" select="substring-before($line,' ')"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
163 |
<xsl:with-param name="dontuse" select="$usedpre"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
164 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
165 |
</xsl:if> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
166 |
</xsl:variable> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
167 |
<xsl:if test="$newprefix!=''"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
168 |
<!-- can treat this as if it were a namespace node --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
169 |
<xsl:element name="{$newprefix}"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
170 |
<xsl:value-of select="$name"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
171 |
</xsl:element> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
172 |
</xsl:if> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
173 |
<xsl:if test="$remainder!=''"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
174 |
<xsl:call-template name="needed-namespaces"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
175 |
<xsl:with-param name="foundns" select="$remainder"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
176 |
<xsl:with-param name="usedpre" select="concat($usedpre,' ',$newprefix,' ')"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
177 |
</xsl:call-template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
178 |
</xsl:if> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
179 |
</xsl:if> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
180 |
</xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
181 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
182 |
<xsl:template match="/SystemDefinition" mode="ns-prefix"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
183 |
<!-- should be able to replace this with mechanism that uses the XSLT processor's own ability to generate namespaces --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
184 |
<xsl:param name="ns"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
185 |
<xsl:param name="pre"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
186 |
<xsl:param name="dontuse"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
187 |
<xsl:param name="chars">ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz</xsl:param> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
188 |
<xsl:variable name="name" select="substring(substring-after($ns,'http://www.'),1,1)"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
189 |
<xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
190 |
<xsl:when test="$pre!='' and $pre!='id-namespace' and not(//namespace::*[name()=$pre]) and not(contains($dontuse,concat(' ',$pre,' ')))"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
191 |
<xsl:value-of select="$pre"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
192 |
</xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
193 |
<xsl:when test="$ns='' and $chars=''"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
194 |
<xsl:message terminate="yes">ERROR: Cannot create namespace prefix for downstream default namespace in <xsl:value-of select="*/@id"/></xsl:message> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
195 |
</xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
196 |
<xsl:when test="$name!='' and not(contains($dontuse,concat(' ',$name,' ')))"><xsl:value-of select="$name"/></xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
197 |
<xsl:when test="namespace::*[name()=substring($chars,1,1)] or contains($dontuse,concat(' ',substring($chars,1,1),' '))"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
198 |
<xsl:apply-templates mode="ns-prefix"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
199 |
<xsl:with-param name="chars" select="substring($chars,2)"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
200 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
201 |
</xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
202 |
<xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
203 |
<xsl:value-of select="substring($chars,1,1)"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
204 |
</xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
205 |
</xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
206 |
</xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
207 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
208 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
209 |
<!-- schema handling --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
210 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
211 |
<xsl:template name="set-schema"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
212 |
<xsl:attribute name="schema"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
213 |
<xsl:apply-templates mode="my-schema" select="/SystemDefinition"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
214 |
</xsl:attribute> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
215 |
</xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
216 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
217 |
<xsl:template name="compare-versions"><xsl:param name="v1"/><xsl:param name="v2"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
218 |
<xsl:choose> |
639
0e65f93be3cb
Joinsysdef schema calculation handles missing files. rootsystef generation does not modify embedded metatdata.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
624
diff
changeset
|
219 |
<xsl:when test="$v1=''"><xsl:value-of select="$v2"/></xsl:when> |
0e65f93be3cb
Joinsysdef schema calculation handles missing files. rootsystef generation does not modify embedded metatdata.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
624
diff
changeset
|
220 |
<xsl:when test="$v1=$v2 or $v2=''"><xsl:value-of select="$v1"/></xsl:when> |
624
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
221 |
<xsl:when test="substring-before($v1,'.') > substring-before($v2,'.')"><xsl:value-of select="$v1"/></xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
222 |
<xsl:when test="substring-before($v1,'.') < substring-before($v2,'.')"><xsl:value-of select="$v2"/></xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
223 |
<xsl:when test="substring-before(substring-after($v1,'.'),'.') > substring-before(substring-after($v2,'.'),'.')"><xsl:value-of select="$v1"/></xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
224 |
<xsl:when test="substring-before(substring-after($v1,'.'),'.') < substring-before(substring-after($v2,'.'),'.')"><xsl:value-of select="$v2"/></xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
225 |
<xsl:when test="substring-after(substring-after($v1,'.'),'.') > substring-after(substring-after($v2,'.'),'.')"><xsl:value-of select="$v1"/></xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
226 |
<xsl:when test="substring-after(substring-after($v1,'.'),'.') < substring-after(substring-after($v2,'.'),'.')"><xsl:value-of select="$v2"/></xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
227 |
<xsl:otherwise><xsl:value-of select="$v1"/></xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
228 |
</xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
229 |
</xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
230 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
231 |
<xsl:template name="compare-version-list"><xsl:param name="list"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
232 |
<xsl:variable name="cur" select="substring-before($list,' ')"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
233 |
<xsl:variable name="remaining" select="substring-after($list,' ')"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
234 |
<xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
235 |
<xsl:when test="$remaining=''"><xsl:value-of select="$cur"/></xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
236 |
<xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
237 |
<xsl:variable name="nextbig"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
238 |
<xsl:call-template name="compare-version-list"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
239 |
<xsl:with-param name="list" select="$remaining"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
240 |
</xsl:call-template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
241 |
</xsl:variable> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
242 |
<xsl:call-template name="compare-versions"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
243 |
<xsl:with-param name="v1" select="$cur"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
244 |
<xsl:with-param name="v2" select="$nextbig"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
245 |
</xsl:call-template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
246 |
</xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
247 |
</xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
248 |
</xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
249 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
250 |
<xsl:template match="/SystemDefinition" mode="my-schema"><xsl:param name="biggest" select="@schema"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
251 |
<xsl:variable name="linked" select="//*[(self::component or self::collection or self::package or self::layer) and @href]"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
252 |
<xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
253 |
<xsl:when test="not($linked)"> <!-- no need to go further --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
254 |
<xsl:call-template name="compare-versions"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
255 |
<xsl:with-param name="v1" select="@schema"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
256 |
<xsl:with-param name="v2" select="$biggest"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
257 |
</xsl:call-template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
258 |
</xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
259 |
<xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
260 |
<xsl:call-template name="compare-version-list"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
261 |
<xsl:with-param name="list"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
262 |
<xsl:for-each select="$linked"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
263 |
<xsl:call-template name="compare-versions"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
264 |
<xsl:with-param name="v1"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
265 |
<xsl:apply-templates mode="my-schema" select="document(@href,.)/*"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
266 |
</xsl:with-param> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
267 |
<xsl:with-param name="v2" select="$biggest"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
268 |
</xsl:call-template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
269 |
<xsl:text> </xsl:text> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
270 |
</xsl:for-each> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
271 |
</xsl:with-param> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
272 |
</xsl:call-template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
273 |
</xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
274 |
</xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
275 |
</xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
276 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
277 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
278 |
<xsl:template match="unit" mode="join"> <xsl:param name="root"/><xsl:param name="filename"/><xsl:param name="data"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
279 |
<xsl:variable name="display"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
280 |
<xsl:apply-templates select="$data" mode="filter"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
281 |
<xsl:with-param name="item" select="current()"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
282 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
283 |
</xsl:variable> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
284 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
285 |
<xsl:if test="$display != 'hide' "> <!-- if hide, remove completely from the output--> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
286 |
<xsl:element name="{name()}"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
287 |
<xsl:apply-templates select="@*" mode="join"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
288 |
<xsl:with-param name="root" select="$root"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
289 |
<xsl:with-param name="filename" select="$filename"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
290 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
291 |
</xsl:element> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
292 |
</xsl:if> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
293 |
</xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
294 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
295 |
<!-- override mode="meta" to translate metadata sections. By default, include --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
296 |
<xsl:template match="meta" priority="2" mode="join"><xsl:param name="data"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
297 |
<xsl:variable name="display"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
298 |
<xsl:apply-templates select="$data" mode="filter"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
299 |
<xsl:with-param name="item" select="current()"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
300 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
301 |
</xsl:variable> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
302 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
303 |
<xsl:if test="$display != 'hide' "> <!-- if hide, remove completely from the output--> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
304 |
<xsl:apply-templates select="." mode="meta"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
305 |
<xsl:with-param name="display" select="$display"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
306 |
<xsl:with-param name="data" select="$data"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
307 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
308 |
</xsl:if> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
309 |
</xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
310 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
311 |
<xsl:template match="meta[@rel='link-mapping']" priority="3" mode="join"/> <!--these are only used in the joining process, so remove from output --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
312 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
313 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
314 |
<xsl:template match="*" mode="join"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
315 |
<xsl:param name="root"/><xsl:param name="filename"/><xsl:param name="namespaces"/><xsl:param name="data"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
316 |
<!-- get attribtues from overlay --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
317 |
<!-- test for presence, if filtered out, just return --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
318 |
<!-- test for children, if it has some, but they're filtered out, either return or leave as empty, dependening on filter rule |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
319 |
if had items and now has none, options: |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
320 |
still has meta: keep / delete |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
321 |
still has comments: keep / delete |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
322 |
--> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
323 |
<xsl:variable name="display"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
324 |
<xsl:apply-templates select="$data" mode="filter"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
325 |
<xsl:with-param name="item" select="current()"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
326 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
327 |
</xsl:variable> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
328 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
329 |
<xsl:if test="$display != 'hide' "> <!-- if hide, remove completely from the output--> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
330 |
<xsl:variable name="href"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
331 |
<xsl:apply-templates select="." mode="link"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
332 |
<xsl:with-param name="data" select="$data"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
333 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
334 |
</xsl:variable> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
335 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
336 |
<xsl:element name="{name()}"> <!-- use this instead of <copy> so xalan doesn't add extra wrong namespaces --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
337 |
<xsl:apply-templates select="@*" mode="join"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
338 |
<xsl:with-param name="namespaces" select="$namespaces"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
339 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
340 |
<xsl:if test="$display != '' "> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
341 |
<!-- custom attribute to indicate how this is to be represented. Blank indicates normal, hide removes from the output (see above), anything else is put in the attribute --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
342 |
<xsl:attribute name="display"><xsl:value-of select="$display"/></xsl:attribute> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
343 |
</xsl:if> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
344 |
<xsl:apply-templates select="$data" mode="overlay-attributes"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
345 |
<xsl:with-param name="item" select="current()"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
346 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
347 |
<xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
348 |
<xsl:when test="$href !='' "> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
349 |
<xsl:variable name="prefixmap" select="ancestor::SystemDefinition/*/meta[@rel='link-mapping']/map-prefix[starts-with($href,@link)]"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
350 |
<xsl:variable name="origin" select="."/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
351 |
<xsl:apply-templates select="document($href,.)/*" mode="join"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
352 |
<xsl:with-param name="origin" select="$origin"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
353 |
<xsl:with-param name="data" select="$data"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
354 |
<xsl:with-param name="namespaces" select="$namespaces"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
355 |
<xsl:with-param name="filename"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
356 |
<xsl:call-template name="joinpath"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
357 |
<xsl:with-param name="file" select="$filename"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
358 |
<xsl:with-param name="rel"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
359 |
<xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
360 |
<xsl:when test="$prefixmap"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
361 |
<xsl:value-of select="$prefixmap/@to"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
362 |
<xsl:value-of select="substring-after($href,$prefixmap/@link)"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
363 |
</xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
364 |
<xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
365 |
<xsl:value-of select="$href"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
366 |
</xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
367 |
</xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
368 |
</xsl:with-param> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
369 |
</xsl:call-template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
370 |
</xsl:with-param> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
371 |
<xsl:with-param name="root"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
372 |
<xsl:value-of select="$root"/>/<xsl:call-template name="lastbefore"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
373 |
<xsl:with-param name="string" select="$href"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
374 |
</xsl:call-template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
375 |
</xsl:with-param> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
376 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
377 |
</xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
378 |
<xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
379 |
<xsl:variable name="content"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
380 |
<xsl:apply-templates select="*|comment()" mode="join"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
381 |
<xsl:with-param name="root" select="$root"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
382 |
<xsl:with-param name="filename" select="$filename"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
383 |
<xsl:with-param name="namespaces" select="$namespaces"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
384 |
<xsl:with-param name="data" select="$data"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
385 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
386 |
</xsl:variable> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
387 |
<xsl:apply-templates select="." mode="is-content-filtered"> <!-- add filtered="yes" if some content has been removed --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
388 |
<xsl:with-param name="content" select="$content"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
389 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
390 |
<xsl:apply-templates select="$data" mode="overlay-meta"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
391 |
<xsl:with-param name="item" select="current()"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
392 |
</xsl:apply-templates> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
393 |
<xsl:copy-of select="$content"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
394 |
</xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
395 |
</xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
396 |
</xsl:element> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
397 |
</xsl:if> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
398 |
</xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
399 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
400 |
<!-- By default, do nothing. Can override template to add filtered="yes" if need to track what's a placeholder and what's been filtered |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
401 |
implement with param name="content" |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
402 |
--> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
403 |
<xsl:template mode="is-content-filtered" match="*" priority="-2"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
404 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
405 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
406 |
<xsl:template match="@mrp[starts-with(.,'/')] | @bldFile[starts-with(.,'/')] | @base[starts-with(.,'/')]" mode="join"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
407 |
<xsl:copy-of select="."/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
408 |
</xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
409 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
410 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
411 |
<xsl:template match="@mrp|@bldFile|@base" mode="join"> <xsl:param name="root"/><xsl:param name="filename"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
412 |
<xsl:attribute name="{name()}"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
413 |
<xsl:call-template name="joinpath"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
414 |
<xsl:with-param name="file" select="$filename"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
415 |
<xsl:with-param name="rel" select="."/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
416 |
</xsl:call-template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
417 |
</xsl:attribute> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
418 |
</xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
419 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
420 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
421 |
<xsl:template match="@href" mode="join"/> <!--never copy this into the generated doc, that's the whole point of this module --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
422 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
423 |
<xsl:template match="@*" mode="my-namespace"> <!-- the namespace of an ID --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
424 |
<xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
425 |
<xsl:when test="contains(.,':')"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
426 |
<xsl:value-of select="ancestor::*/namespace::*[name()=substring-before(current(),':')]"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
427 |
</xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
428 |
<xsl:when test="/SystemDefinition/@id-namespace"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
429 |
<xsl:value-of select="/SystemDefinition/@id-namespace"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
430 |
</xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
431 |
<xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
432 |
<xsl:value-of select="$defaultns"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
433 |
</xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
434 |
</xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
435 |
</xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
436 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
437 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
438 |
<xsl:template match="@*" mode="my-id"> <!-- the ID with namespace prefix removed --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
439 |
<xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
440 |
<xsl:when test="contains(.,':')"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
441 |
<xsl:value-of select="substring-after(.,':')"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
442 |
</xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
443 |
<xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
444 |
<xsl:value-of select="."/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
445 |
</xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
446 |
</xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
447 |
</xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
448 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
449 |
<xsl:template match="*" mode="err-path"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
450 |
<xsl:if test="../@id"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
451 |
<xsl:apply-templates select=".." mode="err-path"/>/</xsl:if> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
452 |
<xsl:value-of select="@id"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
453 |
</xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
454 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
455 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
456 |
<xsl:template match="@id|@before|@replace" mode="join"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
457 |
<xsl:param name="namespaces"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
458 |
<!-- this will change the namespace prefixes for all IDs to match the root document --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
459 |
<xsl:variable name="ns"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
460 |
<xsl:apply-templates select="." mode="my-namespace"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
461 |
</xsl:variable> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
462 |
<xsl:if test="$ns=''"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
463 |
<xsl:message terminate="yes">ERROR: Could not find namespace for <xsl:value-of select="name()"/> "<xsl:value-of select="."/>" in <xsl:apply-templates select="../.." mode="err-path"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
464 |
<xsl:text>
</xsl:text> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
465 |
</xsl:message> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
466 |
</xsl:if> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
467 |
<xsl:variable name="prefix" select="name($namespaces[.=$ns])"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
468 |
<xsl:attribute name="{name()}"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
469 |
<xsl:choose> |
661
199bb033aacf
Bugfixes and additional validation for sysdeftools
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
660
diff
changeset
|
470 |
<xsl:when test="$prefix = 'id-namespace' or $namespaces[name()='id-namespace']=$ns or (not($namespaces[name()='id-namespace']) and $ns=$defaultns)"/> <!-- it's the default namespace, no prefix --> |
624
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
471 |
<xsl:when test="$prefix='' and contains(.,':')"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
472 |
<!-- complex: copy id and copy namespace (namespace should be copied already)--> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
473 |
<xsl:value-of select="."/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
474 |
</xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
475 |
<xsl:when test="$prefix='' and $ns=$defaultns"/> <!-- no prefix and it's the default --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
476 |
<xsl:when test="$prefix!=''"> <!-- just change the prefix --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
477 |
<xsl:value-of select="concat($prefix,':')"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
478 |
</xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
479 |
<xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
480 |
<xsl:message terminate="yes">ERROR: Joining error in resolving namespace for <xsl:value-of select="name()"/> "<xsl:value-of select="."/>" in <xsl:apply-templates select="../.." mode="err-path"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
481 |
<xsl:text>
</xsl:text></xsl:message> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
482 |
</xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
483 |
</xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
484 |
<xsl:apply-templates select="." mode="my-id"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
485 |
</xsl:attribute> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
486 |
</xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
487 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
488 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
489 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
490 |
<xsl:template match="@*|comment()" mode="join"><xsl:copy-of select="."/></xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
491 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
492 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
493 |
<xsl:include href="path-module.xsl"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
494 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
495 |
<!-- overridable templates follow --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
496 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
497 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
498 |
<xsl:template match="*" mode="filter" priority="-9"/> <!-- by default show --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
499 |
<xsl:template match="*" mode="overlay-attributes" priority="-9"/> <!-- by default do nothing --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
500 |
<xsl:template match="*" mode="overlay-meta" priority="-9"/> <!-- by default do nothing --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
501 |
<xsl:template match="/SystemDefinition" mode="add-id-ns" priority="-9"/> <!-- some tools may have an easier job if this were always present, but, by default, assume it can just stay implied --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
502 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
503 |
<xsl:template match="*" mode="link" priority="-1"> <!-- can be overriden to allow custom changes to href values --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
504 |
<xsl:value-of select="@href"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
505 |
</xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
506 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
507 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
508 |
<xsl:template match="*" mode="meta" priority="-9"><xsl:param name="data"/><xsl:param name="display"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
509 |
<xsl:element name="{name()}"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
510 |
<xsl:copy-of select="@*[name()!='href']"/> <!-- copy all attributes as is, always drop href --> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
511 |
<xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
512 |
<xsl:when test="$display='local' and @href and contains(@href,':') and not(starts-with(@href,'file:'))"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
513 |
<!-- non-local URL: only want local URLs, so keep href as is--> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
514 |
<xsl:copy-of select="@href"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
515 |
</xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
516 |
<xsl:when test="@href"> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
517 |
<xsl:copy-of select="document(@href,.)/*"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
518 |
</xsl:when> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
519 |
<xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
520 |
<xsl:copy-of select="*|comment()"/> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
521 |
</xsl:otherwise> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
522 |
</xsl:choose> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
523 |
</xsl:element> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
524 |
</xsl:template> |
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
525 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
526 |
|
f70b728ea30c
Move sysdeftools from buildtools package into build package
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff
changeset
|
527 |
</xsl:stylesheet> |