Help to select FIXED/VERIFIED/CLOSED

Petterson Mikael

Usenet Archive
Joined
Nov 27, 2002
Messages
89
Reaction score
0
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>
 

Joe Kesselman

Usenet Archive
Joined
Feb 3, 2006
Messages
1,229
Reaction score
0
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
548,049
Messages
3,104,244
Members
248,133
Latest member
DujonT

Latest Threads

Top