Re: [xsl] XPath problem with getting all ancestors

Subject: Re: [xsl] XPath problem with getting all ancestors
From: Vyacheslav Sedov <vyacheslav.sedov@xxxxxxxxx>
Date: Fri, 23 Oct 2009 19:42:31 +0400
you can pack whole result to variable at first stage and at second
calculate counters (but why?) all this counters can be calculated any
time later if needed (it  is some kind of denormalization)

On Fri, Oct 23, 2009 at 6:25 PM, Jostein Austvik Jacobsen
<josteinaj@xxxxxxxxx> wrote:
> The actual template does more than copying; it uses recursion to group
> sections started by headlines at different levels defined by its
attributes.
> I got it from this post:
>
http://www.biglist.com/lists/lists.mulberrytech.com/xsl-list/archives/200910/
msg00228.html
>
> The function works really well (except for cases when a headline level is
> skipped). So if its possible to keep copying the nodes it would be great;
> otherwise I'll have to fix the function (I'm thinking of expanding the
> recursion into four xls:for-each-group statements - it's not allowed to go
> deeper anyway).
>
> I'll do sone further testing once I get back to the computer.
>
> Regards
> Jostein
>
> Den 23. okt. 2009 kl. 15.20 skrev "Michael Kay" <mike@xxxxxxxxxxxx>:
>
>>>   <xsl:template match="article">
>>>       <xsl:variable name="v1">
>>>           <xsl:copy-of select="content/node()"/>
>>>       </xsl:variable>
>>>       <xsl:sequence select="mf:group($v1/node())"/>
>>>   </xsl:template>
>>
>> As I suspected, you are copying the nodes, and the copies do not have the
>> same ancestors.
>>
>> It's not clear to me WHY you are copying them - it seems quite
>> unnecessary.
>>
>> Regards,
>>
>> Michael Kay
>> http://www.saxonica.com/
>> http://twitter.com/michaelhkay

Current Thread