Re: [xslt] libxslt and inline node sets combining into a variable timeout problems



Hi Olmo,

> select="com:node-set($contents)/*"
this has to be in scope of a namespace declaration
   xmlns:com="http://exslt.org/common";
(prefix exsl is used frequently instead of com).

Hope this helps,

Manfred

On 17/05/2008, Olmo Maldonado <olmo maldonado gmail com> wrote:
> Sorry for the spamming. I've stopped the timing out and the error for now:
>
>  Here's the exact code:
>
>         <xsl:variable name="page-content">
>                 <h3>test</h3>
>         </xsl:variable>
>
>         <xsl:variable name="contents">
>
>                 <xsl:copy-of select="$entry/body" />
>
>                 <xsl:copy-of select="$page-content" />
>         </xsl:variable>
>
>         <xsl:variable name="content" select="com:node-set($contents)/*" />
>
>
>         <xsl:variable name="need-page-navigation"
>
> select="count($content[h2|h3|h4]) > 0" />
>
>  I'm still having an issue with the count() showing up as 0, though. As
>  you can see the $content should have the $page-content, which has an
>  h3 element. So the count should at least be 1. This might be another
>  path problem. So I'll keep fiddling with this. Keep me posted, if you
>  guys can think of a better way to do what I'm doing. Additionally I'm
>  curious to see why I can't assign the node-set to a variable.
>
>  Olmo
>
>  On Sat, May 17, 2008 at 9:02 AM, Olmo Maldonado
>
> <olmo maldonado gmail com> wrote:
>  > I've noticed that if I don't assign the node-set to another variable I
>  > do not time out.
>  >
>  > For example:
>  >
>  >        <xsl:variable name="page-content">
>  >                <h3>test</h3>
>  >        </xsl:variable>
>  >
>  >        <xsl:variable name="content">
>  >                <xsl:copy-of select="$entry/body" />
>  >                <xsl:copy-of select="$page-content" />
>  >        </xsl:variable>
>  >
>  >        <xsl:variable name="need-page-navigation"
>  > select="count(com:node-set($content)[h2|h3|h4]) > 0" />
>  >
>  > Does not throw an error. The need-page-navigation is set to false,
>  > though. I believe this is still another affect of the result tree
>  > fragment.
>  >
>  > On Sat, May 17, 2008 at 8:00 AM, Olmo Maldonado
>  > <olmo maldonado gmail com> wrote:
>  >> Hello,
>  >>
>  >> I'm running PHP 5 with libxslt extension. I'm consolidating a node set
>  >> from my xml as well as a tree fragment from another variable:
>  >>
>  >>        <xsl:variable name="page-content">
>  >>                <h3>test</h3>
>  >>        </xsl:variable>
>  >>
>  >>        <xsl:variable name="contents">
>  >>                <xsl:copy-of select="/data/page/title/entry/body" />
>  >>                <xsl:copy-of select="$page-content" />
>  >>        </xsl:variable>
>  >>
>  >> From what I've read I cannot do the following because of the $content
>  >> is a tree fragment:
>  >>
>  >>        <xsl:variable name="need-page-navigation"
>  >> select="count($contents[h2|h3|h4])" />
>  >>
>  >> As a result, I have attempted:
>  >>
>  >>        <xsl:variable name="page-content">
>  >>                <h3>test</h3>
>  >>        </xsl:variable>
>  >>
>  >>        <xsl:variable name="contents">
>  >>                <xsl:copy-of select="/data/page/title/entry/body" />
>  >>                <xsl:copy-of select="$page-content" />
>  >>        </xsl:variable>
>  >>        <xsl:variable name="content" select="exsl:node-set($contents)" />
>  >>
>  >>        <xsl:variable name="need-page-navigation" select="count($content[h2|h3|h4])" />
>  >>
>  >> When I try running this again, my server times out. I've tried to get
>  >> to the kernel of the problem and it seems it is the node-set. I
>  >> simplified the above to just:
>  >>
>  >>        <xsl:variable name="page-content">
>  >>                <h3>test</h3>
>  >>        </xsl:variable>
>  >>        <xsl:variable name="content" select="exsl:node-set($page-content)" />
>  >>        <xsl:variable name="need-page-navigation" select="count($content[h2|h3|h4])" />
>  >>
>  >> And still I timeout.
>  >>
>  >>
>  >> Thanks for your time.
>  >>
>  >
>  _______________________________________________
>  xslt mailing list, project page http://xmlsoft.org/XSLT/
>  xslt gnome org
>  http://mail.gnome.org/mailman/listinfo/xslt
>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]