View Single Post
Old October 17th, 2013, 03:43 AM
mhkay's Avatar
mhkay mhkay is offline
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts

>I've been struggling with building this code for about 6 hours now and each forum I consult do not seem to have a viable solution.

I wonder if you're using the most effective strategy for solving your problem. Given that you are on a Wrox site, I would expect you to tell us how long you have spent looking for a solution in Wrox's wonderful technical books.

Your code seems very strange, because you will only go into the "when" branch if @idOwner = 'Onboarding_Event', but you will only execute any of the contained "if" expressions if @idOwner is some other value. So I would expect it to always execute the when branch, and none of the "if" expressions within the "when" branch.

I think the most likely explanation for your problems is something to do with context. You haven't shown enough of your source and stylesheet for us to see the full context, which is often a telltale sign that a poster doesn't understand the importance of context. Are you sure the Id element shown is the context item? Are you sure the namespace context is correct? If so, show us enough code so that we can be sure of this too.
Michael Kay
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference