• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

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

 
Ranch Hand
Posts: 314
2
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 314
2
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Got it.

The XPath expression that I need to use is:



Darryl
 
this llama doesn't want your drama, he just wants this tiny ad for his mama
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic