Rank: Newbie
Joined: 5/19/2008 Posts: 3 Location: London
|
I have a basic query which I'm having trouble with (XSLT1.0)
I have written (nicked) an external function that gives me the max values of a set of values, it works lovely and I call it from within my main stylesheet.
simple source xml
<TABLE> <RECORD> <FLAG>N</FLAG> <IP> <ID>2</ID> <NAME>jenny</NAME> </IP> </RECORD> <RECORD> <FLAG>N</FLAG> <IP> <ID>7</ID> <NAME>dick</NAME> </IP> <IP> <ID>3</ID> <NAME>jim</NAME> </IP> <IP> <ID>5</ID> <NAME>amanda</NAME> </IP> </RECORD> <RECORD> <FLAG>Y</FLAG> <IP> <ID>3</ID> <NAME>keri</NAME> </IP> <IP> <ID>1</ID> <NAME>mark</NAME> </IP> <IP> <ID>2</ID> <NAME>jane</NAME> </IP> </RECORD> </TABLE>
What i'm after is the person's name who record is flagged and who's ID is the highest (hence the max function).
My XSLT stylesheet looks like this which gives me the correct max value, 3 in this instance however I need the name. Anyone help me out of a simple pickle?
....snip <NAME> <xsl:call-template name="math:max"> <xsl:with-param name="values" select="/RECORD/[FLAG = 'Y']/IP/ID"/> </xsl:call-template> </NAME> ....snip
|