xsl-list
[Top] [All Lists]

Re: [xsl] Fwd: Selecting First Child of Ancestor using Xpath

2013-11-20 09:29:39
Nathan Tallman wrote:

I'm working on a template that matches on c04, then has an
xsl:for-each for the did (so did is m context node). I am transforming
this into an HTML table.

I'd like to do an xsl:coose/when to test for the first c04 child of
c03, so I can add table headers. As this is processing all dids I need
the test to specifically catch the first c04 child. However
test="../../c04[1]" does not seem to be doing the trick.

You could test
  <xsl:if test=".. is ../../c04[1]">
to check whether the parent of the context node is the first c04 child element of the ancestor.

It all looks to me as if you should rather change the approach to use matching template with appropriate match patterns and apply-templates instead of "for-each".

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