xsl-list
[Top] [All Lists]

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

2012-09-13 10:35:28
First establish whether doc() is returning a document. If it is, then you are processing the document incorrectly (and it's nothing to do with HTTP). If it isn't, then you've got some configuration issue.

Michael Kay
Saxonica

On 13/09/2012 16:20, Ihe Onwuka wrote:
OK this is a long shot, but the endpoint gives me the correct response
when I paste the http call into the browser . When I make the same
call from the document function I get a response from the application
saying it couldn't find any records.

I've escaped the only apostrophe in the http call. Is there any reason
why I should be getting a different response when calling via XSLT?



On Thu, Sep 13, 2012 at 2:47 PM, Andrew Welch 
<andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com> wrote:
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>
--~--

--~------------------------------------------------------------------
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>
--~--




--~------------------------------------------------------------------
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>
--~--