Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan Okkels Brendstrup 101 posts 197 karma points
    Oct 17, 2011 @ 14:10
    Dan Okkels Brendstrup
    0

    Debugging an msxml:node-set() related crash?

    I'm attempting to use msxml:node-set() to transform result tree fragment to a node-set. If I feed the function an actual node-set (which is completely redundat, I know) then all is well, but when I feed it an RTF, the site stalls completely, an will eventually crash the app pool.

    Where can I find debugging/loggin information to determine what is wrong? Or does the problem sound familiar to anyone?

    I'll attach a snippet of code for reference, but I'll be happy to plow through error logs myself, if anyone can point me in the right direction.

        <!--Only show categories that have both a title and associated publications in the current language-->
        <xsl:variable name="unsorted-categories" select="Category[normalize-space(*[name() = concat('title', $lang_upcase)])][count(key(concat($lang_code, '-publications-by-category'), @id)) &gt; 0]"/>
        <xsl:variable name="sorted-categories">
          <xsl:for-each select="$unsorted-categories">
            <xsl:sort select="*[name() = concat('title', $lang_upcase)]"/>
            <xsl:copy-of select="."/>
          </xsl:for-each>
        </xsl:variable>
        <xsl:variable name="categories" select="msxml:node-set($sorted-categories)"/>
        <ul>
           <xsl:apply-templates select="$categories"/>
        </ul>
    

    [msxml:node-set($sorted-categories) will crash, but msxml:node-set($unsorted-categories) will work.]

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 7x admin c-trib
    Oct 17, 2011 @ 14:18
    Chriztian Steinmeier
    0

    Hi Dan,

    You're probably doing all this in the "root" ("/") template, right? Your categories variable ends up having its own root element, so...

    You should make sure to select specific elements e.g., msxml:node-set($sorted-categories)/*

    /Chriztian

     

  • Dan Okkels Brendstrup 101 posts 197 karma points
    Oct 17, 2011 @ 14:33
    Dan Okkels Brendstrup
    0

    My good man, you are a genius.

    You're totally right. I'm actually running the above code within a match template below the root level, but by changing $categories to select msxml:node-set($sorted-categories)/Category, then everything works like a charm.

    I would've sworn I'd already tried exactly that after reading something similar in another forum post, but I must've done it wrong.

    Thanks for saving my sanity!

Please Sign in or register to post replies

Write your reply to:

Draft