Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSL, current node, and nav bar

Status
Not open for further replies.

selvirino

Programmer
Jun 18, 2001
17
US
I am an XSL newbie.

I have a simple XML that I want to use with XSL to create an HTML page displaying the value of a given node along with a navigation bar with forward and back buttons to browse that node's siblings. My function already knows the value of the node it wants to display, and is passing that value into a parameter in the XSL.

My problem is that I can't seem to get the XSL to set the current node to the node containing the value in my parameter. I assume once I get the current node selected, I can use the sibling functions in XPATH to get the values of the preceding and following siblings to apply to my nav bar buttons.

My XML is something like:

<book>
<chapter name=&quot;xyz&quot;>
<images>
<small>images/smallimage1.jpg</small>
<big>images/bigimage1.jpg</big>
</images>
<images>
<small>images/smallimage2.jpg</small>
<big>images/bigimage2.jpg</big>
</images>
<images>
<small>images/smallimage3.jpg</small>
<big>images/bigimage3.jpg</big>
</images>
</chapter>
<chapter name=&quot;abc&quot;>
.
.
.
</book>

In my example, I pass the value for 'images/smallimage2.jpg' into my XSL. I want the XSL to create HTML displaying the image and providing arrow buttons with links to pass the value for either the preceding or following <small> sibling.

Any help will be most appreciated.
 
Woops. One amendment: my nav bar won't navigate siblings, but to the closest preceding or following <small> node. Technically, the navigation will be between cousins.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top