You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Matt Smith <M....@secureinteractive.com> on 2001/01/16 01:22:59 UTC

Character Escaping Problems

Heres my problem:
I have some content stored in a database, and the content contains <BR>
tags.  I need the tags to be recognised by the web browser so that it
inserts a new lines.  I am using JDBC to access the database via a back end
API.  
 
I have tried storing it as <BR/> in the database and using <xsp:expr> tags
to pass it as a variable, but XSP escapes the angled brackets, and the tags
appeared literally in the browser ( I expected this, but though I would try
it anyway).  Next, I tried the same content passed to <util:expr> tags (I
made sure that the content was surrounded by a root element).  In this case,
XSP replaced the <BR/> tag with a newline character.  So then I tried
wrapping the content in a CDATA tag before passing it through a <util:expr>
tag.  This caused the browser to print the tags again, instead of rendering
them.  Lastly, I have tried storing the tag as &#60;br/&#62; before passing
it through <util:expr>.  Same result as the last two.  In all cases here,
the XSL is just selecting the value of the XML tag containing the content.
Nothing fancy is happening there.
 
Does anyone know how to get around this?  Am I missing something obvious and
simple?  
 
Thanks for any help,
Matt
 
 

Re: Character Escaping Problems

Posted by Donald Ball <ba...@webslingerZ.com>.
On Tue, 16 Jan 2001, Matt Smith wrote:

> Heres my problem:
> I have some content stored in a database, and the content contains <BR>
> tags.  I need the tags to be recognised by the web browser so that it
> inserts a new lines.  I am using JDBC to access the database via a back end
> API.
>
> I have tried storing it as <BR/> in the database and using <xsp:expr> tags
> to pass it as a variable, but XSP escapes the angled brackets, and the tags
> appeared literally in the browser ( I expected this, but though I would try
> it anyway).  Next, I tried the same content passed to <util:expr> tags (I
> made sure that the content was surrounded by a root element).  In this case,
> XSP replaced the <BR/> tag with a newline character.  So then I tried
> wrapping the content in a CDATA tag before passing it through a <util:expr>
> tag.  This caused the browser to print the tags again, instead of rendering
> them.  Lastly, I have tried storing the tag as &#60;br/&#62; before passing
> it through <util:expr>.  Same result as the last two.  In all cases here,
> the XSL is just selecting the value of the XML tag containing the content.
> Nothing fancy is happening there.
>
> Does anyone know how to get around this?  Am I missing something obvious and
> simple?

yes. use the latest esql logicsheet from cvs and the get-xml method. you
may need to use the root attribute to fake a root node. note you will need
to store it as <br/> in the database. can't parse generic html yet.

- donald