Re: [xsl] Same name Elements in more than one node

Subject: Re: [xsl] Same name Elements in more than one node
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 26 Dec 2001 14:51:48 -0500
Mike,

At 12:49 PM 12/26/01, you wrote:
The problem is
that I want to get the ENCODINGANALOG attribute for each PERSNAME
element I output.

That's natural.


 Since I cannot figure out how to write for the
current node PERSNAME for an instance of two PERSNAME elements,

<xsl:value-of select="./PESNAME[2]"/>
<xsl:value-of select="./@ENCODINGANALOG[2]"/>

That's what templates are for!


then I decided to write two for-each statements, one inside another,
to take care of it. It is clumsy and awkward and very very
frustrating, but it works....

Ugh! you'll find the "solution" scales poorly and is very brittle.


Is there any reason *not* to use templates?

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


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread