93 lines
3.6 KiB
HTML
93 lines
3.6 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!--
|
|
~~~~~~licensing~~~~~~
|
|
update-management-support
|
|
==========
|
|
Copyright (C) 2020 - 2023 EmDev LLC
|
|
==========
|
|
You may not use this file except in accordance with the License Terms of the Copyright
|
|
Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
|
rights to the Software and any copies are the property of the Copyright Holder. Unless
|
|
it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
|
Software for commercial purposes to provide services to third parties.
|
|
|
|
The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
|
Under no circumstances does the Copyright Holder guarantee or promise that the
|
|
Software provided by him will be suitable or not suitable for the specific purposes
|
|
of the User, that the Software will meet all commercial and personal subjective
|
|
expectations of the User, that the Software will work properly, without technical
|
|
errors, quickly and uninterruptedly.
|
|
|
|
Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
|
to the User for any direct or indirect losses of the User, his expenses or actual
|
|
damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
|
or damage to data, property, etc.
|
|
~~~~~~/licensing~~~~~~
|
|
-->
|
|
|
|
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">
|
|
<xsl:output method="text" version="1.0" encoding="UTF-8" indent="yes"/>
|
|
|
|
<xsl:param name="currentVersion" />
|
|
|
|
<xsl:template match="/">
|
|
<xsl:apply-templates select="child::node()" />
|
|
</xsl:template>
|
|
|
|
<xsl:template match="//source-versions/version[@name=$currentVersion]">
|
|
<xsl:text>installPlan = new java.util.ArrayList
|
|
</xsl:text>
|
|
<xsl:for-each select="./plan/child::element()">
|
|
<xsl:call-template name="create-plan-item" />
|
|
</xsl:for-each>
|
|
</xsl:template>
|
|
|
|
<xsl:template name="create-plan-item">
|
|
<xsl:text>$installPlan add [operation="</xsl:text><xsl:value-of select="./name()" /><xsl:text>"</xsl:text>
|
|
<xsl:for-each select="./child::node()[not(self::comment() | self::text())]">
|
|
<xsl:call-template name="create-plan-item-attribute" />
|
|
</xsl:for-each>
|
|
<xsl:for-each select="./attribute()">
|
|
<xsl:call-template name="create-plan-item-attribute" />
|
|
</xsl:for-each>
|
|
<xsl:text>]
|
|
</xsl:text>
|
|
</xsl:template>
|
|
|
|
<xsl:template name="create-plan-item-attribute">
|
|
<xsl:variable name="value" select="." />
|
|
|
|
<xsl:variable name="targetName">
|
|
<xsl:choose>
|
|
<xsl:when test="./name()='feature-name'">feature</xsl:when>
|
|
<xsl:otherwise>
|
|
<xsl:value-of select="./name()" />
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:variable>
|
|
|
|
<xsl:variable name="result">
|
|
<xsl:choose>
|
|
<xsl:when test="./name()='reboot'"><xsl:value-of select="concat('"', $value, '"')" /></xsl:when>
|
|
<xsl:otherwise>
|
|
<xsl:choose>
|
|
<xsl:when test="$value='true'">(__TRUE__)</xsl:when>
|
|
<xsl:when test="$value='false'">(__FALSE__)</xsl:when>
|
|
<xsl:when test="number($value)=number($value)"><xsl:value-of select="$value" /></xsl:when>
|
|
<xsl:otherwise><xsl:value-of select="concat('"', $value, '"')" /></xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:variable>
|
|
|
|
<xsl:value-of select="concat(' ', $targetName,'=',$result)" />
|
|
</xsl:template>
|
|
|
|
<xsl:template name="default-remove" match="node()|@*">
|
|
<xsl:apply-templates select="node()|@*" />
|
|
</xsl:template>
|
|
|
|
|
|
|
|
</xsl:stylesheet>
|