Feels like a lot of work to make a linebreak a <br/> tag...If I rephrase the question: What would be the simplest way
of displaying the database strings with correct linebreaks in html (except using <pre> in the xsl)?
thanks
Anders
Yes, you cannot use tags inside java strings in this fashion. When XSP sees this tag, it tries to insert a whole block of code to output the tag into the SAX output, which should give you a compilation error.
I'm actually not certain how it is you are able to pass the results of esql:get-xml into a function call without getting compilation errors. The get-xml tag also turns into a whole block of code, not an expression which can be passed to a function. What version of Cocoon are you using? In C2.0.3, which I am using, you would be unable to do this, and you would be unable to do substitutions inside the returned XML. Instead, you'd have to get the results using get-string, do your substitutions (using < in place of <), then run the resulting String through an XML parser to get it into the SAX stream. (A good example of this is the code that implements get-xml in the ESQL logicsheet, which is in your cocoon jar file.)
HTH.
-Christopher
|---------+----------------------------> | | Anders Forsgren | | | <[EMAIL PROTECTED]| | | rmers.com> | | | | | | 11/04/2003 04:31 | | | PM | | | Please respond to| | | users | | | | |---------+----------------------------> >--------------------------------------------------------------------------------------------------------------| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: XSP/ESQL escaping | >--------------------------------------------------------------------------------------------------------------|
>Where and how is formatMessage() implemented? That is the code we really
>need to see, I think.
Thanks for your time
The formatMessage is implemented above the problem in the xsp logic section, and it (currently) only does this :
<xsp:logic> public string formatMessage(String message) { return instring.replaceAll("\n", "<br/>) } </xsp:logic>
the problem area in the xsp, like I said looks like this
<body><xsp:expr>formatMessage(<esql:get-xml column="body"/>)</xsp:expr></body>
The problem occurs when the xsp:expr contains tags (i.e. if I do the replace "\n" ---> "foo" , then all is well, but "\n" ---> "<foo/>" will not work. )
rgds
Anders
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]