doedje / jquery.soap

This script uses $.ajax to send a SOAP:Envelope. It can take XML DOM, XML string or JSON as input and the response can be returned as either XML DOM, XML string or JSON too.
352 stars 148 forks source link

fix/enhancements for working with CDATA sections #119

Closed ChristofVerhoeven closed 7 years ago

ChristofVerhoeven commented 7 years ago

regex replaced with indexOf('<![CDATA['). there are 3 possibilities: no CDATA blocks (encode with existing func), 1 single CDATA block (no encoding) and CDATA block(s) somewhere within the value (encode with new function encodeXmlValueWithCDataCheck)

encodeXmlValueWithCDataCheck() should work in any case, but is slower than the existing encodeXmlValue() function. The check on "indexOf CDATA" (in order to avoid this new function) is therefor a performance enhancement.

doedje commented 7 years ago

Hi Christof, Sorry for the late reply, but thanx a lot for both your additions!