IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

XSLT newbie any clues?? Options · View
kerihughes
Posted: Tuesday, May 20, 2008 6:13:38 PM
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
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.