xsl-list
[Top] [All Lists]

Re: [xsl] Getting variable yet most immediate parentNode

2007-09-28 10:41:57
Steve wrote:

I think we've gone awry. .//answer's doesn't make sense because, as
Wendell pointed out, I want to go up the tree if there is no child
<answers />. I tried his syntax, however I'm not sure how to make it
choose a child answer's node before it goes looking for the closest
ancestral answer node (without using those pesky case statements).

I added the .// in my proposed solution because I inversed your logic (i.e., I started the match from the parent of the answer nodes and applied the answer nodes from there with .//). But, like you said yourself already, the source you showed, both in XSLT and in XML contained errors and that may have made me make the wrong assumptions about what structure is and what structure is not possible (or effective).

But I saw that Wendell's solution "up the tree" works just fine, which is nice to hear :)

About understanding what you are after: I've looked through the thread but still haven't seen a clean output that you have now (so we can mimic your current stylesheet) and the output that you are after, so it is just guessing at what you really want with your code. Or have you found the correct solution already?

Cheers,
-- Abel Braaksma

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--