wood burning stoves 2.0*
The moose likes JSP and the fly likes How do I retrieve ancestor-or-self nodelist in a JSP page using the JSP XML taglibs? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "How do I retrieve ancestor-or-self nodelist in a JSP page using the JSP XML taglibs?" Watch "How do I retrieve ancestor-or-self nodelist in a JSP page using the JSP XML taglibs?" New topic
Author

How do I retrieve ancestor-or-self nodelist in a JSP page using the JSP XML taglibs?

Darryl A. J. Staflund
Ranch Hand

Joined: Oct 06, 2002
Posts: 303
Hi all,

I am developing a JSP-based breadcrumb component that reads in the following (similar) sitemap document:



and generates a breadcrumb based on the user's current URI. For instance, if the user's URI is currently '/roleAdd.html', the Breadcrumb would look as follows (with all the appropriate links taken from the file):



I am using the JSTL XML tag library to implement the breadcrumb. The code I am currently testing with looks as follows:



What I need to do in order to finish my breadcrumb is replace the line:



with one that looks something like the following:



This line would retrieve a nodelist consisting of all ancestors from the root of the tree directly to (and including) the node with the URI that the user is currently viewing. I can't seem to figure out the syntax for this though.

I am running Tomcat 6.0.18 with the latests versions of JSP and Xalan-j. Can someone tell me what the correct syntax should look like?

Thanks,
Darryl
Darryl A. J. Staflund
Ranch Hand

Joined: Oct 06, 2002
Posts: 303
Got it.

The XPath expression that I need to use is:



Darryl
 
GeeCON Prague 2014
 
subject: How do I retrieve ancestor-or-self nodelist in a JSP page using the JSP XML taglibs?