Help to select FIXED/VERIFIED/CLOSED

P

Petterson Mikael

Hi,

I want to use Xpath to select the last activity if <newvalue> is set to
FIXED, VERIFIED or CLOSED.

cheers,

//mikael
XSL template
============
.........
<xsl:template name="issue_date">
<xsl:param name="issue-id"/>
<xsl:for-each select="//issue">
<xsl:if test="./issue_id = $issue-id">
<div class="issue-type">
<xsl:value-of
select="substring(./activity[last()]/when ,1,11)"/>
</div>
</xsl:if>
</xsl:for-each>
</xsl:template>
..........


XML issues
===========

.......
<activity>
<user>jacekrad</user>
<when>2006-04-01 12:48:30</when>
<field_name>resolution</field_name>
<field_desc>Resolution</field_desc>
<oldvalue></oldvalue>
<newvalue>FIXED</newvalue>
</activity>
 
J

Joe Kesselman

Petterson said:
Hi,

I want to use Xpath to select the last activity if <newvalue> is set to
FIXED, VERIFIED or CLOSED.

Assuming you mean "the last activity which has a newvalue set to one of
these", one of several ways to express that would be

select="substring(./activity[newvalue="FIXED" or newvalue="VERIFIED" or
newvalue="CLOSED"][last()]/when ,1,11)"/>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top