|
Subject: Re: [xsl] searching for occurrences of unique string-value and replacing with string value of another node From: Julie <julie.newcome@xxxxxxxxx> Date: Thu, 5 Jun 2008 17:39:03 -0400 |
So sorry! I didn't get the original thread deleted before replying...
On Thu, Jun 5, 2008 at 5:28 PM, Julie <julie.newcome@xxxxxxxxx> wrote:
> Thank you for your reply, Michael.
>
> I put this code in but I do not get a result for the link, just ".html".
>
> I can evaluate the xpath expressions through xmlspy, but this is a
> function so that doesn't work...is there any other way to evaluate
> what is in the key?
>
>>
>> Using a key is a good idea. I do not understand what you mean with a sub-node, try this:
>>
>> <xsl:key name="targetFile" match="File" use=".//CuHistoryGuid/text()"/>
>>
>> <xsl:template match="RelatedLinks/CuRef">
>> <a class="old" href="{@CuHistoryGuid}.html">
>> <xsl:apply-templates/>
>> </a>
>> <a class="new" href="{key('targetFile', @CuHistoryGuid)/FileGuid/text()}.html">
>> <xsl:apply-templates/>
>> </a>
>> </xsl:template>
>>
>> The key "targetFile" indexes all elements File according to the text content of their descendant "CuHistoryGuid".
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] searching for occurrences, Julie | Thread | Re: [xsl] searching for occurrences, Michael Müller-Hille |
| Re: [xsl] searching for occurrences, Julie | Date | RE: [xsl] two at a time, using a se, Michael Kay |
| Month |