trying to form xml data to post in ajax call

trying to form xml data to post in ajax call

Hi,

the server i'm trying to post data to in an ajax call expects data in xml format, including a particular attribute value. I have to use Chrome browser which does not support the XML Class (e4x). I tried to marshal my data as follows:

var xmldoc =
 "<field fid='nn' filename='test.txt'>" + 
   base64encodeddata +
 "</field>";


But the ajax call does not appear to transfer the xml data to the server even though the xmlhttprequest call appears ok in Chrome's developer tool console.

$.ajax( {
url:                 "https://some.url.com",
contentType:  "application/xml",    -- also tried 'text/xml'
processData:  false,
data:              xmldoc,
type:              "POST",
success:        function() {
                     ...
                     }
} );

I'm wondering whether I'm forming the xml formatted data correctly. Any help would be much appreciated.

-CL