Re: [xsl] Iterate through tree structure

Subject: Re: [xsl] Iterate through tree structure
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 31 Mar 2009 13:57:16 -0400
At 01:20 PM 3/31/2009, you wrote:
LOL.  Thank you so much!  That was embarasingly easy once you pointed
out that I should match against the element.  So all I needed was
this...

Cool.


It's slightly different to your approach where you suggested
<xsl:apply-templates mode="list-dir"
select="parent::dir/ancestor::dir"/>.  Could you tell me what this
does?

Well, applying templates is no different than using for-each, except instead of working with nodes directly, you are selecting them to be matched by templates (which can then be used to differentiate processing according to the types of elements, etc.). Selecting "parent::dir/ancestor::dir" is using XPath to select a set of 'dir' element ancestors, specifically excluding the parent 'dir' element. This was just a guess on my part, that those were the elements representing values you wanted listed (values that would have been generated by the templates then matched).


Cheers,
Wendell



======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

Current Thread