cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Per Kreipke" <...@onclave.com>
Subject RE: HTML inside XML
Date Tue, 17 Oct 2000 14:40:59 GMT
You should be able to simply enclose the HTML inside a CDATA section.

XML allows marked off portions of text. The sections are marked off with
PCDATA (parsed canonical data) or CDATA (unparsed canonical data).

Simply surround your text section like this:

<![CDATA[
your <funky> text here
]]>

Per.

> -----Original Message-----
> From: Jimi Thompson [mailto:jthompson@link.com]
> Sent: Monday, October 16, 2000 7:23 PM
> To: cocoon-users@xml.apache.org
> Subject: Re: HTML inside XML
>
>
> Andy,
>
> I'm new at this myself, so that may well be the blind leading the blind,
> but there is a way to turn off parsing for a portion of the document,
> which I think will solve your problem.  You DON'T want the email parsed
> (if I am understanding this correctly).  I will try to find out what it
> is, but I think I saw a note about it in the W3C specs.  Until I can
> locate this and see if it applies to you, you might try looking at
> XML.org because I think I might have see that there too.
>
> Sorry I'm not more help,
>
> Jimi
>
> Andy Parker wrote:
>
> > I've been reading through the archives in order to see if
> > this question has been answered before, but I haven't been
> > able to find it, so here goes.
> >
> > I'm trying to get an XSP page to display the contents of an
> > email message.  The problem occurs when the email isn't in
> > just a normal plain text form.  If the email is in HTML I
> > can't get it to send the HTML out to the requesting client
> > without altering the HTML.
> >
> > I've tried:
> >
> > <xsp:expr>message.getContent()</xsp:expr>
> >
> > But then it converts all < and > to &lt; and &gt;
> >
> > So then I saw someone suggest using util:include-expr, which
> > I tried and gave the error unknown function valueOf(or
> > something like that).
> >
> > So then I tried something with parsing the
> > message.getContent string into nodes and inserting them into
> > the document.  I don't remember the code for that but it was
> > covered in a thread in the archives.  This caused the XML
> > parser to complain that META needs to be closed.  Of course,
> > HTML usualy isn't valid XML so it won't work this way.
> >
> > I've also tried inserting a CDATA section into the document
> > with the createCDATASection function of
> > org.apache.xerces.dom.Document class.  This does the same
> > things as the <xsp:expr> one.
> >
> > I looked into the util taglib and saw util:expr, and decided
> > why not? what can it hurt.  So I tried that:
> >
> > <util:expr>message.getContent()</util:expr>
> >
> > which outputs
> >
> > message.getContent()
> >
> > So does anyone have any suggestion how I can, in essence,
> > pass some data within the document all the way out without
> > the XML parser(Xerces) trying to parse it?
> >
> > Thanks for listening to my rambling,
> > Andrew Parker
>
> --
> Jimi Thompson
> Web Master
> L3 communications
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>


Mime
View raw message