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="xyz">
<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="abc">
.
.
.
</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.
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="xyz">
<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="abc">
.
.
.
</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.