This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of Zero to AI - A non-technical, hype-free guide to prospering in the AI era and have Nicolò Valigi and Gianluca Mauro on-line!
See this thread for details.
Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

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
  • 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
  • Quote
  • Report post to moderator
Got it.

The XPath expression that I need to use is:



Darryl
 
Watchya got in that poodle gun? Anything for me? Or this tiny ad?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic