ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nascif Abousalh-Neto" <Nascif.AbousalhN...@sas.com>
Subject Duplicate entries in resolve report
Date Tue, 30 Oct 2007 20:31:22 GMT
Hi all,

We are reading the resolved module descriptor generated in the ivy cache
to extract information about the complete list of dependencies, both
names and versions, for an internal process that requires them in a
simple text file. I created a simple XSLT transformation to capture
those values, but we found that sometimes there are multiple "revision"
nodes for the same "module" - the only difference being the value of the
attribute "search", as in the example below.

The result is that in those cases is that I have multiple lines for
version. So clearly I need to add another test in the XSLT. My question
is, how do I find which revision is the one that was actually selected?
I already have a check to skip "evicted-by", is that any other test that
would give me the correct result? 

I think I need to look for 'searched="true"' in my XPath check, but I am
not sure. Any suggestions?
Thanks,
  Nascif

Example with multiple entries:

<module organisation="SAS" name="sas.web.framework"
resolver="sas-example">
  <revision name="4.2.0.20071030042610" status="integration"
pubdate="20071030042635" resolver="ivyfiles" artresolver="sas-example"
downloaded="false" searched="true" default="false" conf="compile"
position="64">
    <caller organisation="SAS" name="sas.portal.persistence.impl"
conf="compile" rev="latest.integration"/>
    <caller organisation="SAS" name="sas.portal.persistence"
conf="compile" rev="4.2.0.20071030042610"/>
    <artifacts>
      <artifact name="sas.web.framework" type="jar" ext="jar"
status="successful" size="762034">
      </artifact>
    </artifacts>
  </revision>
  <revision name="4.2.0.20071030042610" status="integration"
pubdate="20071030042635" resolver="ivyfiles" artresolver="sas-example"
downloaded="false" searched="false" default="false" conf="compile"
position="64">
    <caller organisation="SAS" name="sas.portal.persistence.impl"
conf="compile" rev="latest.integration"/>
    <caller organisation="SAS" name="sas.portal.persistence"
conf="compile" rev="4.2.0.20071030042610"/>
    <artifacts>
      <artifact name="sas.web.framework" type="jar" ext="jar"
status="successful" size="762034">
      </artifact>
    </artifacts>
  </revision>

Here is the current XSLT:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text" encoding="iso-8859-1"/>
<xsl:param name="curr_project"></xsl:param>
<xsl:param name="curr_version">.</xsl:param>
<xsl:template match='/ivy-report/dependencies'>
PickList-Version=1

name=<xsl:value-of select="$curr_project"/> 
version= <xsl:value-of select="$curr_version"/> 

<xsl:for-each select="module">
name=<xsl:value-of select="@name"/>
    <xsl:for-each select="revision">
      <xsl:choose>
        <xsl:when test="evicted-by">
## (evicted) version=<xsl:value-of select="@name"/>
      </xsl:when>
      <xsl:otherwise>
version=<xsl:value-of select="@name"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:for-each>
<xsl:text>
</xsl:text>
</xsl:for-each>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>

Mime
View raw message