Re: [xsl] Templates not applied to output of document HTTP call

Subject: Re: [xsl] Templates not applied to output of document HTTP call
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Thu, 13 Sep 2012 14:47:48 +0100
> The code below ignores it's input and is supposed to apply templates
> to the output of the HTTP call in the doc function, however it hangs.

>     <xsl:template match="/">
>        <xsl:apply-templates select="doc('http://blah')"/>
>     </xsl:template>

This is a classic gotcha - your root matching template will endlessly
'loop' as you apply-templates to document node returned by the doc()
function.

The solution is to do select="doc('http://blah')/*" or use modes if
you need to handle the document node.



-- 
Andrew Welch
http://andrewjwelch.com

Current Thread