xsl-list
[Top] [All Lists]

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

2012-09-13 08:47:58
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--