[ic] How to include HTTP GET response in an IC page
Daniel Davenport
DDavenport at newagedigital.com
Fri Jul 28 16:42:52 EDT 2006
> -----Original Message-----
> From: interchange-users-bounces at icdevgroup.org
> [mailto:interchange-users-bounces at icdevgroup.org] On Behalf
> Of Jon Jensen
> Sent: 2006 July 26 -- Wednesday 1:07 PM
> To: interchange-users at icdevgroup.org
> Subject: Re: [ic] How to include HTTP GET response in an IC page
>
> On Wed, 26 Jul 2006, DB wrote:
>
> > The tag works if I use it like this:
> > [get-url "http://example.com/mypage.xml"]
> >
> > and if I view the source of the resulting page I see:
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns="http://www.example.com">
> > <string>the_result</string>
> > <string xsi:nil="true" />
> > </ArrayOfString>
> >
> > as expected. However if I try
> >
> > [calcn]
> > my $page = $Tag->get_url('http://www.example.com/mypage.xml');
> > $page =~ m!<string>(.+?)</string>!;
> > $1;
> > [/calcn]
> >
> > then all I see is 0
>
> What's in your error.log?
>
> It may be that the get_url tag code does something un-Safe
> and thus can't
> be run from a calc block. You may need to write a usertag instead.
>
> Jon
or.....move the get_url out of the calc block. :)
[tmp page][get-url url="http://example.com/mypage.xml"][/tmp]
[calcn] ($Scratch->{page} =~ m!<string>(.+?)</string>!) and $1; [/calcn]
--
Daniel Davenport
New Age Digital
http://www.newagedigital.com
More information about the interchange-users
mailing list