Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: xpath ancestors

From: Chuck Jungmann <NOchuckSPAM@----.--->
To: NULL
Date: 1/10/2008 4:23:00 PM

On Thu, 10 Jan 2008 17:58:59 +0100, Martin Honnen <mahotrash@y...> wrote:

>Chuck Jungmann wrote:
>
>> 	<xsl:template match="node()" mode="nameNode">
>
>Note that node() does _not_ match the root node so you need
>   <xsl:template match="/ | node()" mode="nameNode">
>here.
>
>> 	<xsl:template match="node()" mode="makePath">
>
>Same here
>   <xsl:template match="/ | node()" mode="makePath">
>
>Otherwise the default template would kick in which processes the child 
>nodes of the root node and that way you don't get the results you are 
>looking for and even recursion in the latter case.

Thank you for the response.

Actually, I had been trying to use XSL to identify the returned nodes, but then
I realized that, for the purposes of understanding what was happening, I could
use the DOM in Javascript and examine the results in a debugger.  I was just
going to respond to myself to say what I had learned (ie that
"ancestor-or-self::node() returned the document node and that using
"ancestor-or-self::*" didn't) when I read your response.





transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent