XML WAResponse with HTML code from WARenderCanvas

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

XML WAResponse with HTML code from WARenderCanvas

Thomas Fischer
Hi list,
I serve XML (KML) for a google maps web application via WAResponse and XMLWriter.
It works fine, but now I need CDATA sections with HTML fragments inside the KML.

I have a WARenderCanvas (as method argument to renderContentOn:). I like to use this canvas to produce the HTML code fragments.

But: How can I produce the HTML code with the WARenderCanvas and pass the code to the stream of the XML WAResponse as HTML snippets?

salute
Thomas
Reply | Threaded
Open this post in threaded view
|

Re: XML WAResponse with HTML code from WARenderCanvas

Philippe Marschall
2007/10/17, Thomas Fischer <[hidden email]>:

>
> Hi list,
> I serve XML (KML) for a google maps web application via WAResponse and
> XMLWriter.
> It works fine, but now I need CDATA sections with HTML fragments inside the
> KML.
>
> I have a WARenderCanvas (as method argument to renderContentOn:). I like to
> use this canvas to produce the HTML code fragments.
>
> But: How can I produce the HTML code with the WARenderCanvas and pass the
> code to the stream of the XML WAResponse as HTML snippets?

WAHtmlBuilder in Seaside 2.8 is your friend here. It will give you
unescapted html. What you do with this is up to you. Please not that
CDATA will break if you have ]]> somewhere in your content. This is
the cause of about 0.02% of all rss feed errors.

Cheers
Philippe

> salute
> Thomas
> --
> View this message in context: http://www.nabble.com/XML-WAResponse-with-HTML-code-from-WARenderCanvas-tf4641522.html#a13256832
> Sent from the Squeak - Seaside mailing list archive at Nabble.com.
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: XML WAResponse with HTML code from WARenderCanvas

Thomas Fischer

<quote author="Philippe Marschall">
> WAHtmlBuilder in Seaside 2.8 is your friend here. It will give you
> unescapted html.

Thanks for your answer!
If I use WAHtmlBuilder, I have not the same context as my current WARenderCanvas - isn't it?

My application scenario:
I produce a HTML page with a WAComponent. I use "urlForAction: aBlock" to get a URL for the block which response my XML document. This XML will requested by the Browser via AJAX. The HTML fragments inside the XML will render as part of the current browser page. These HTML fragments has anchors and forms.

I like to produce this HTML in the same way as in the "renderContentOn:" method of my WAComponent to have the same context for callbacks.

Wrong track?

salute
Thomas
Reply | Threaded
Open this post in threaded view
|

Re: XML WAResponse with HTML code from WARenderCanvas

Thomas Fischer
<quote author="Thomas Fischer">
> If I use WAHtmlBuilder, I have not the same context as my current WARenderCanvas - isn't it?

I've found the solution in

    SUObject>>render: anObject on: aStream

and now I use a new Canvas with same context and callbacks as the origin canvas

salute
Thomas