<br/> in xhtml

Hi, I'm trying to generate HTML output in a servlet using XML literals. But
doesn't work the way I'd like it to... scala> val html = some text
some more html: scala.xml.Elem = some text
some more scala> html.toString res0: String = some text
some more That renders as two line breaks in Firefox and Safari. I need it to stay as
. Anyone know how to do that? thanks, Rob

Re: <br/> in xhtml

On Thu, Sep 03, 2009 at 02:02:35PM -0400, Robert Nikander wrote: > scala> val html = some text
some more > html: scala.xml.Elem = some text
some more > > scala> html.toString > res0: String = some text
some more scala> val html = some text
some more html: scala.xml.Elem = some text
some more scala> xml.Xhtml.toXhtml(html) res0: String = some text
some more

XHTML

Anybody know if there is a way to keep the scala libs from escaping the quotes in certain sections of my html where I'd like them?

For example, even when I Xhtml.toXhtml() my Nodes they go from:

<html>
<head>
<script type="text/javascript">
alert("Foo!");
<script>
</head>
<body>
</body>
</html>

to (notice the ")

<html>
<head>
<script type="text/javascript">
alert("Foo!&quot);
<script>
</head>
<body>
</body>
</html>

Lift must deal with this problem. Anybody know offhand how they do it? I've searched through the Lift source, but I can't really locate it.

Thanks,
Dustin

Re: XHTML



On Sat, Oct 24, 2009 at 9:04 PM, <dustin [dot] whitney [at] gmail [dot] com> wrote:
Anybody know if there is a way to keep the scala libs from escaping the quotes in certain sections of my html where I'd like them?

For example, even when I Xhtml.toXhtml() my Nodes they go from:

<html>
<head>
<script type="text/javascript">
alert("Foo!");
<script>
</head>
<body>
</body>
</html>

to (notice the ")

<html>
<head>
<script type="text/javascript">
alert("Foo!&quot);
<script>
</head>
<body>
</body>
</html>

Lift must deal with this problem. Anybody know offhand how they do it? I've searched through the Lift source, but I can't really locate it.

We wrote parallel methods that convert XML to String and deal correctly with the CDATA type.  You can see more in the AltXML object in Lift's PCDataMarkupParser.scala file: http://github.com/dpp/liftweb/blob/master/lift-base/lift-util/src/main/scala/net/liftweb/util/PCDataMarkupParser.scala  

Thanks,
Dustin



--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

Copyright © 2013 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland