How can I include a XML file as content in a textarea element in a XHTML document? It will cause validation errors if the special characters are not escaped.
Is there an easy way in JSP to escape special characters before they are inserted using the include directive, like using the JSTL?
Example code:
<div>
<textarea name="content" rows="20" cols="80"><%@ include file="example.xml" %></textarea>
</div>
This will look fine in a browser, but XHTML validation will fail because the embedded file starts another XML declaration.