• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

XSLT context node question

Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I just finished doing a homework assignment using XSLT, and I had a question about the context node. In my xml document, there were person objects and project objects. Persons have an id, and projects have an idref to refer to a person as an assignment. What I needed to do was to create a report listing each person and the projects they were assigned to. It seems that when I used a template match to locate the persons, I couldn't call another template match from the person level context to locate a project because the context node was now located at the same level in the tree as project. I ended up getting around this by using xsl:for-each tags. I looped through each person, and from each person, I looped through the projects he/she were assigned to by comparing the id with the idref. This worked fine, but differently from doing a template match. Is there a reason why my template match was constrained by the current context, but the xsl:for-each wasn't? Sorry this question is so complex. Thanks,

[ July 15, 2004: Message edited by: Ryan P. Kane ]
author & internet detective
Posts: 41073
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can always go back and edit/delete your posts by clicking the pencil/paper icon (third icon) near the top of your post.
My honeysuckle is blooming this year! Now to fertilize this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
    Bookmark Topic Watch Topic
  • New Topic