Репозиторий Sisyphus
Последнее обновление: 6 марта 2021 | Пакетов: 17845 | Посещений: 20416183
en ru br
Репозитории ALT
S:1.2.0-alt1_2jpp8
5.1: 1.1-alt1_3jpp5
4.1: 1.1-alt1_1jpp1.7
4.0: 1.1-alt1_1jpp1.7
3.0: 1.1-alt0.1beta2
www.altlinux.org/Changes

Группа :: Разработка/Java
Пакет: jaxen

 Главная   Изменения   Спек   Патчи   Исходники   Загрузить   Gear   Bugs and FR  Repocop 

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="map" />
<xsl:output method="xml" indent="yes" omit-xml-declaration="no"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/project" >
<xsl:element name="project">
<xsl:copy-of select="child::*[not(self::dependencies)]"/>
<xsl:if test="not(./dependencies)">
<xsl:element name="dependencies">
<xsl:for-each select="document($map)//add/dependency">
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:element>
</xsl:if>
<xsl:apply-templates select="dependencies"/>
</xsl:element>
</xsl:template>
<xsl:template match="dependencies" >
<xsl:element name="dependencies">
<xsl:for-each select="dependency">
<xsl:if test="./artifactId">
<xsl:call-template name="replace">
<xsl:with-param name="artifact" select="./artifactId/text()"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="./id">
<xsl:choose>
<xsl:when test="substring-after(./id/text(),':') != ''">
<xsl:call-template name="replace">
<xsl:with-param name="artifact" select="substring-after(./id/text(),':')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="replace">
<xsl:with-param name="artifact" select="./id/text()"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
<xsl:for-each select="document($map)//add/dependency">
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:element>
</xsl:template>
<xsl:template name="replace">
<xsl:param name="artifact"/>
<xsl:variable name="this" select="."/>
<xsl:choose>
<xsl:when test="document($map)//dependency/maven[./artifactId/text() = $artifact]">
<xsl:for-each select="document($map)//dependency/maven[./artifactId/text() = $artifact][1]">
<xsl:if test="../jpp">
<xsl:element name="dependency">
<xsl:copy-of select="../jpp/*"/>
<xsl:copy-of select="$this/properties"/>
</xsl:element>
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:element name="dependency">
<xsl:copy-of select="./*"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="document($map)//dependency/maven[./artifactId/text() = $artifact]">
<xsl:for-each select="document($map)//dependency/maven[./artifactId/text() = $artifact][1]">
<xsl:for-each select="../add/dependency">
<xsl:element name="dependency">
<xsl:copy-of select="./*"/>
<xsl:copy-of select="$this/properties"/>
</xsl:element>
</xsl:for-each>
</xsl:for-each>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin