Hi,
Tempore 01:12:17, die 09/08/2005 AD, hinc in
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com scripsit Pape, Nathan S.
<Nathan(_dot_)Pape(_at_)ngc(_dot_)com>:
Basically my source document contains a group of two or more aliases, as
in the element named: <OTHER_NAME>
, and I just need to move them to the result tree under only one
element
Try the following templates:
<xsl:template match="/">
<xsl:element name="abcxyz:transaction">
<xsl:element name="abcxyz:record">
<xsl:attribute name="type"><xsl:value-of
select="2"/></xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:element>
</xsl:template>
<xsl:template name="process_record" match="OTHER_NAME[1]">
<xsl:element name="abcxyz:field">
<xsl:attribute name="name">
<xsl:value-of select="'T2_AKA'"/>
</xsl:attribute>
<xsl:attribute name="number">
<xsl:value-of select="19"/>
</xsl:attribute>
<xsl:apply-templates select="../OTHER_NAME"
mode="group_aliases"/>
</xsl:element>
</xsl:template>
<xsl:template match="OTHER_NAME[position()!=1]"/>
<xsl:template match="OTHER_NAME/*" mode="group_aliases">
<xsl:element name="abcxyz:subfield">
<xsl:element name="abcxyz:item">
<xsl:value-of select="."/>
</xsl:element>
</xsl:element>
</xsl:template>
regards,
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Deserta faciunt et innovationem appelant
--~------------------------------------------------------------------
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>
--~--