Index: core/src/main/java/org/icefaces/context/DOMResponseWriter.java =================================================================== --- core/src/main/java/org/icefaces/context/DOMResponseWriter.java (revision 21802) +++ core/src/main/java/org/icefaces/context/DOMResponseWriter.java Fri Jul 16 15:21:18 EEST 2010 @@ -31,6 +31,7 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; +import org.w3c.dom.CDATASection; import javax.faces.component.UIComponent; import javax.faces.component.UIViewRoot; @@ -285,6 +286,17 @@ writeText(text, property); } + public void startCDATA() throws IOException { + if (null == document) { + document = DOMUtils.getNewDocument(); + } + pointCursorAt(appendToCursor(document.createCDATASection(""))); + } + + public void endCDATA() throws IOException { + pointCursorAt(cursor.getParentNode()); + } + public ResponseWriter cloneWithWriter(Writer writer) { String enc = getCharacterEncoding(); String type = getContentType(); @@ -304,11 +316,15 @@ return clone; } - - // private Node appendToCursor(String data) { + if (cursor instanceof CDATASection) { + CDATASection section = (CDATASection) cursor; + section.appendData(data); + return section; + } else { - return appendToCursor(document.createTextNode(data)); - } + return appendToCursor(document.createTextNode(data)); + } + } private Node appendToCursor(Node node) { try {