[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Getting max attribute value of an element by attribute
I have the following substructure in an XML file I'm working with. <classes> <class name="Fighter" short="Ftr" level="1" hp="10" uri="../class/fighter.xml"/> <class name="Rogue" short="Rog" level="1" hp="3" uri="../class/rogue.xml"/> <class name="Fighter" short="Ftr" level="2" hp="5" uri="../class/fighter.xml"/> </classes> I'm trying to get this as the output. Ftr(2), Rog(1) Currently, I can only figure out how to get this: Ftr(1), Rog(1), Ftr(2) The template I'm using currently stands as: <xsl:template name="listClasses"> <xsl:for-each select="classes/class"> <xsl:value-of select="@short"/>(<xsl:value-of select="@level"/>)<xsl:if test="not(position() = last())">, </xsl:if> </xsl:for-each> </xsl:template> How can I change the template to sort the <class>es so they are all grouped with the first appearance of the class, and I only get the highest level of the class inside the parenthesis? - Theo XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|