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)) > 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.]
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.
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.
[msxml:node-set($sorted-categories) will crash, but msxml:node-set($unsorted-categories) will work.]
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
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!
is working on a reply...