Subject: Re: [xsl] XPath problem with getting all ancestors From: Jostein Austvik Jacobsen <josteinaj@xxxxxxxxx> Date: Mon, 26 Oct 2009 10:24:18 +0100 |
I ended up un-nesting the recursion (four levels deep) that that code was for so now there's no copy statements left and things are working great. Thanks for the help folks! Regards Jostein 2009/10/23 Vyacheslav Sedov <vyacheslav.sedov@xxxxxxxxx>: > 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XPath problem with gettin, Vyacheslav Sedov | Thread | [xsl] WYM editor, Senthilukvelaan |
Re: RE: [xsl] Assistance with posi, James A. Robinson | Date | [xsl] Variables, David Galligani |
Month |