Aladdin - Scala Bugtracking
[#862] project: compiler priority: low category: feature
submitter assigned to status date submitted
Nikolay Burak fixed 2006-12-06 12:58:44.0
subject [contrib #269] CDATA statements ignored
code
val x = <html&ht;<body><![CDATA[   <hello>     Moo Moo]]></body></html>


what happened
Results in a parse tree of
class scala.xml.Elem
  class scala.xml.Elem
    class scala.xml.Text

and the text element is output as escaped text
what expected Parse tree of: class scala.xml.Elem class scala.xml.Elem class scala.xml.CDATA That the toString method preserves the CDATA section. This is because writing a Script tag in XHTML, the contents of the script tag should be in a CDATA and the CDATA should be rendered out the browser
[back to overview]
Changes of this bug report
Nikolay  edited on  2006-12-06 12:59:50.0
Contribution #269
Burak  edited on  2006-12-06 13:57:48.0
This is actually a feature: CDATA gets desugarized to text, because that is what it really is. For the use case of generating scripts, see FAQ entry on script's in scala.xml
Burak  edited on  2006-12-06 13:57:57.0