buildframework/helium/sf/java/sysdef/demo/data/sf/os/buildtools/bldsystemtools/sysdeftools/lib/usage.xsl
author wbernard
Fri, 13 Aug 2010 14:59:05 +0300
changeset 628 7c4a911dc066
permissions -rw-r--r--
helium_11.0.0-e00f171ca185
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
     1
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
     2
<xsl:output method="text"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
     3
<xsl:param name="usage"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
     4
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
     5
<xsl:template match="node()|@*"><xsl:copy-of select="."/></xsl:template>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
     6
<xsl:template match="/*">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
     7
	<xsl:apply-templates select="." mode="desc"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
     8
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
     9
	<xsl:variable name="in">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    10
		<xsl:call-template name="input"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    11
	</xsl:variable>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    12
	<xsl:variable name="out">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    13
		<xsl:call-template name="output"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    14
	</xsl:variable>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    15
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    16
	<xsl:if test="$usage != ''">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    17
		<xsl:text>&#xa;usage: </xsl:text><xsl:value-of select="$usage"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    18
	</xsl:if>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    19
	<xsl:if test="$usage != '' and contains($out,'&gt;')"> [<xsl:value-of select="substring-before($out,'&gt;')"/>&gt;]  [params ...] <xsl:value-of select="substring-before($in,'&gt;')"/>&gt;</xsl:if>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    20
		<xsl:choose>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    21
			<xsl:when test="system-property('xsl:vendor-url') = 'http://xml.apache.org/xalan-c' ">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    22
The input file must be last. Other arguments can be in any order. 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    23
Parameters are case-sensitive. Text parameter values must be in single quotes.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    24
</xsl:when>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    25
			<xsl:when test="system-property('xsl:vendor-url') = 'http://xml.apache.org/xalan-j' ">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    26
Arguments can be in any order. 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    27
Parameters are case-sensitive.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    28
</xsl:when>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    29
			<xsl:when test="system-property('xsl:vendor-url') = 'http://xmlsoft.org/XSLT/' ">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    30
The input file must be last. Other arguments can be in any order. 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    31
Parameters are case-sensitive.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    32
</xsl:when>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    33
		</xsl:choose>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    34
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    35
	<xsl:text>&#xa;&#9;</xsl:text>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    36
		<xsl:call-template name="input"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    37
	<xsl:text>&#xa;&#9;</xsl:text>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    38
		<xsl:call-template name="output"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    39
	<xsl:apply-templates select="." mode="params"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    40
</xsl:template>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    41
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    42
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    43
<xsl:template match="/*" mode="desc">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    44
	<xsl:value-of select="substring-after(comment()[starts-with(.,'Description:')],':')"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    45
	<xsl:apply-templates select="document(xsl:import/@href | xsl:include/@href,.)/*" mode="desc"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    46
</xsl:template>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    47
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    48
<xsl:template match="/*" mode="params">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    49
	<xsl:for-each select="xsl:param">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    50
		<xsl:text>&#xa;&#9;</xsl:text>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    51
		<xsl:choose>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    52
			<xsl:when test="system-property('xsl:vendor-url') = 'http://xml.apache.org/xalan-c' ">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    53
				<xsl:text>-p </xsl:text>			
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    54
			</xsl:when>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    55
			<xsl:when test="system-property('xsl:vendor-url') = 'http://xml.apache.org/xalan-j' ">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    56
				<xsl:text>-param </xsl:text>			
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    57
			</xsl:when>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    58
			<xsl:when test="system-property('xsl:vendor-url') = 'http://xmlsoft.org/XSLT/' ">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    59
				<xsl:text>--string-param </xsl:text>			
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    60
			</xsl:when>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    61
		</xsl:choose>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    62
		<xsl:value-of select="concat(@name,' ')"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    63
		<xsl:for-each select="following-sibling::node()[self::* or self::comment()][1]">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    64
			<xsl:if test="self::comment()">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    65
			<xsl:value-of select="."/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    66
			</xsl:if>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    67
		</xsl:for-each>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    68
		<xsl:text>&#xa;</xsl:text>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    69
		<xsl:if test="not(*) and normalize-space(.)!='' ">&#9;&#9;Defaults to <xsl:choose>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    70
			<xsl:when test="system-property('xsl:vendor-url') = 'http://xml.apache.org/xalan-c' ">'<xsl:value-of select="."/>'</xsl:when>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    71
			<xsl:when test="system-property('xsl:vendor-url') = 'http://xml.apache.org/xalan-j' ">"<xsl:value-of select="."/>"</xsl:when>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    72
			<xsl:when test="system-property('xsl:vendor-url') = 'http://xmlsoft.org/XSLT/' ">"<xsl:value-of select="."/>"</xsl:when>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    73
		</xsl:choose></xsl:if>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    74
	</xsl:for-each>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    75
	<xsl:apply-templates select="document(xsl:import/@href | xsl:include/@href,.)/*" mode="params"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    76
</xsl:template>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    77
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    78
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    79
<xsl:template name="string"><xsl:param name="look">Description</xsl:param>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    80
	<xsl:variable name="s">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    81
		<xsl:value-of select="substring-after(comment()[starts-with(.,concat($look,':'))],':')"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    82
	</xsl:variable>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    83
	<xsl:choose>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    84
		<xsl:when test="$s != ''"><xsl:value-of select="$s"/></xsl:when>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    85
		<xsl:otherwise>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    86
			<xsl:for-each select="document(xsl:import/@href | xsl:include/@href,.)/*">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    87
				<xsl:call-template name="string">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    88
					<xsl:with-param name="look" select="$look"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    89
				</xsl:call-template>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    90
			</xsl:for-each>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    91
		</xsl:otherwise>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    92
	</xsl:choose>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    93
</xsl:template>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    94
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    95
<xsl:template name="input">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    96
	<xsl:variable name="p">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    97
		<xsl:call-template name="string">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    98
			<xsl:with-param name="look" select="'Input'"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    99
		</xsl:call-template>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   100
	</xsl:variable>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   101
		<xsl:choose>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   102
			<xsl:when test="system-property('xsl:vendor-url') = 'http://xml.apache.org/xalan-c' "/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   103
			<xsl:when test="system-property('xsl:vendor-url') = 'http://xmlsoft.org/XSLT/' "/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   104
			<xsl:when test="system-property('xsl:vendor-url') = 'http://xml.apache.org/xalan-j' ">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   105
				<xsl:text>-in </xsl:text>			
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   106
			</xsl:when>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   107
		</xsl:choose>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   108
	<xsl:if test="$p =''  ">&lt;xml&gt; - (required) The input XML file</xsl:if>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   109
	<xsl:if test="$p !=''  "><xsl:value-of select="$p"/></xsl:if>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   110
	<xsl:text>&#xa;</xsl:text>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   111
</xsl:template>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   112
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   113
<xsl:template name="output">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   114
	<xsl:variable name="p">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   115
		<xsl:call-template name="string">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   116
			<xsl:with-param name="look" select="'Output'"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   117
		</xsl:call-template>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   118
	</xsl:variable>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   119
	<xsl:choose>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   120
		<xsl:when test="system-property('xsl:vendor-url') = 'http://xml.apache.org/xalan-c' ">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   121
			<xsl:text>-o </xsl:text>			
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   122
		</xsl:when>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   123
		<xsl:when test="system-property('xsl:vendor-url') = 'http://xml.apache.org/xalan-j' ">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   124
			<xsl:text>-out </xsl:text>			
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   125
		</xsl:when>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   126
		<xsl:when test="system-property('xsl:vendor-url') = 'http://xmlsoft.org/XSLT/' ">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   127
			<xsl:text>-o </xsl:text>			
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   128
		</xsl:when>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   129
	</xsl:choose>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   130
	<xsl:if test="$p =''  ">&lt;file&gt; - (optional) The <xsl:value-of select="xsl:output/@method"/> file to save the output as. If not present it will write to stdout.</xsl:if>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   131
	<xsl:if test="$p !=''  "><xsl:value-of select="$p"/></xsl:if>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   132
	<xsl:text>&#xa;</xsl:text>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   133
</xsl:template>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   134
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   135
</xsl:stylesheet>