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
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.
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.