You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Leszek Gawron <lg...@mobilebox.pl> on 2005/09/04 11:42:07 UTC
Re: HTML embedded in XML
footh wrote:
> In Javaflow, I call out to a web service (Google's, to
> be specific) and get a bunch of results returned.
> Then, I combine these results into my own XML DOM
> object, stuff the object into a Parameter map and send
> it off to a JX page. As a result, I can easily inject
> the XML fragment into my page by merely writing the
> variable out.
>
> However, the results sometimes have HTML embedded
> within them (example, <b></b> tags to bold certain
> words). Using the method described above, this
> embedded HTML gets converted to > and <
> somewhere along the way.
>
> I'm wondering at what point this occurs (building the
> DOM object, or the JX engine printing out the DOM
> object) and if there is any simple way to retain the
> HTML. I have an idea for an ugly way to resolve this
> but was hoping that someone on the list might have
> some insight.
Three solutions:
For any version:
parse the string to DOM yourself. JX will take proper advantage of that.
For 2.1.x:
http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=108680748429717&w=2
For cocoon 2.2 trunk you can use:
<jx:out value="${myXmlString}" xmlize="true|false"
strip-root="true|false"/> - not yet documented as I patched jx:out on
Saturday :)
--
Leszek Gawron lgawron@mobilebox.pl
IT Manager MobileBox sp. z o.o.
+48 (61) 855 06 67 http://www.mobilebox.pl
mobile: +48 (501) 720 812 fax: +48 (61) 853 29 65
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org