xsl-list
[Top] [All Lists]

Re: [xsl] A way to test only top level nodes to see if they have children

2012-08-28 11:13:13
It would *really* help if you'd give us short snippet of input and of
desired output. See the posting guidelines at
http://www.mulberrytech.com/xsl/xsl-list/#posting

That said, if your input uses the same element type for top level and
lower level nav entries (in this case, <li>), you may be able to
match the top-level entries with
   <xsl:template match="li">
     <!-- process w/o assigning a link)
   </xsl:template>
and the lower-level nav entries with
   <xsl:template match="li//li">
     <!-- assign a link -->
   </xsl:template>

I have a navigation list that I am assigning links to every /parent
node that doesn't have children. Every nested list (children of the
top level parents) needs to have links assigned to them always.
Only effecting the top level nodes on the test is hard for me to
grasp. Any help?

Eg: (for when top level nav has children)
home (no link assigned)
Child (link assigned)
Child (link assigned)
      Grandchild (link assigned)
Child (link assigned)

Eg:  (for when top level nav has no children)
Some Top Level Nav (no link assigned)

--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>