I have an XML file with company data in it, for 30 companies across 8 industries, on a portfolio page. The user has the option to sort this data by Industry, and this XML file will be added to constantly.
This sorting is done in my XSL file using <xsl:choose>
. Example:
<xsl:when test="(invest[@investid='con'])">
<xsl:for-each select="$invest-port/portfolio/company[@industry='Communications']">
<xsl:sort select="name" />
<div class="invest-port-thumb">
<a>
<xsl:attribute name="href">
<xsl:value-of select="link" />
</xsl:attribute>
</a>
</div>
</xsl:for-each>
</xsl:when>
When navigating to an individual company's page, there are "previous" and "next" buttons at the bottom of the window. My issue is that I need these to dynamically link to the previous and next <link>
elements from within the XML data that has been sorted.
Part of the master XML file:
<portfolio recact="1">
<company industry="Industrial" status="Current" coid="1">
<name>Horn Company</name>
<hq>Owensboro, KY</hq>
<link>horn.xml</link>
</company>
<company industry="Consumer" status="Current" coid="1">
<name>Mike Waters Co</name>
<hq>Orlando, FL</hq>
<link>waters.xml</link>
</company>
</portfolio>
Is this possible? Or is there an easier way to do this? (such as place each company in industry-divided XML files instead of one)
Any insight would be greatly appreciated!