- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
<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
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
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
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!");
<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:
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
--
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