|
Posted by Harlan Messinger on 12/02/06 16:22
noah wrote:
> My user needs to cut and paste XML and submit it using a simple HTML
> form.
>
> I have created a textarea:
>
> <textarea rows="10" cols="60" name="xml">
> </textarea>
>
> The problem is the special characters in the XML mess up the submit. I
> need everything pasted to this textarea to be treated like CDATA (I
> think), or somehow full escaped.
Can you be more clear than "mess up the submit"? What is the actual
error that's occurring? Characters like <, >, ', ", etc. work just fine
in forms. The most likely problem that comes to mind is that you're
trying to put the data into a database by building a query string in
your application like
sql = "insert into T (xml) values ('" + xmlInput + "')";
and the input data has apostrophes (single quotes) in it that need to be
escaped to keep the SQL engine from treating them as delimiters in the
query.
Navigation:
[Reply to this message]
|