Linking to an item in another node (XSLT)

Posted by Andrew Parisi on Stack Overflow See other posts from Stack Overflow or by Andrew Parisi
Published on 2010-05-11T16:07:51Z Indexed on 2010/05/11 16:54 UTC
Read the original article Hit count: 301

Filed under:
|
|
|

I have an XML document with companies listed in it. I want to create a link with XSLT that contains the <link> child of the next node. Sorry if this is confusing..here is some sample XML of what i'm trying to obtain:

<portfolio>

<company>
<name>Dano Industries</name>
<link>dano.xml</link>
</company>

<company>
<name>Mike and Co.</name>
<link>mike.xml</link>
</company>

<company>
<name>Steve Inc.</name>
<link>steve.xml</link>
</company>

</portfolio>

I want two links, "BACK" and "NEXT". While currently on mike.xml, I want BACK to link to "dano.xml" and NEXT linked to "steve.xml"...etc..and have it dynamically change when on a different page based on the nodes around it. I want to do this because I may add and change the list as I go along, so I don't want to have to manually re-link everything.

How can I obtain this? Sorry I am new to XSLT, so please explain with solution if possible! Thanks in advance!

© Stack Overflow or respective owner

Related posts about Xml

Related posts about xslt