Subject: Re: priority of key patterns
From: Ihe Onwuka <ihe.onwuka@xxxxxxxxx>
Date: Wed, 14 Nov 2012 10:37:06 +0000
|
On Wed, Nov 14, 2012 at 10:24 AM, Andrew Welch <andrew.j.welch@xxxxxxxxx> wrote:
>> Regarding other use cases for keys in patterns - I tend to do my
>> renames like this
>>
>> <xsl:key name="mapNames" match="ren:*/@to" use="../@from"/>
>> <xsl:variable name="renames">
>> <ren:element from="EmployeeCategory" to="Name"/>
>> <ren:element from="PersonName" to="Name"/>
>> <ren:element from="FormerlyKnown" to="Name"/>
>
>
> I would just do:
>
> <xsl:template match="EmployeeCategory | PersonName | FormerlyKnown">
> <Name>
>
I cut the examples off with .... too early. Here are a few more
illustrating the more general case for which that solution will not
work.
<ren:element from="Directors" to="Names"/>
<ren:element from="ParentCompany" to="Names"/>
<ren:element from="LegalStatusAdditional" to="AdditionalInfo"/>
<ren:element from="EmployeeChanges" to="Changes"/>
.
.
.
|