Menu

#2 iwfXmlDoc does not parse correctly

v1.0_(example)
open
nobody
5
2008-10-07
2008-10-07
No

In xmltest.html, there is the following:

var doc = new iwfXmlDoc("<?xml version='1.0' encoding='UTF-8'?> <SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> <SOAP-ENV:Body> ...</SOAP-ENV:Body> </SOAP-ENV:Envelope>");

alert(doc);

alert(doc.SOAP_ENV__Envelope.xmlns__SOAP_ENV);

But this does not work, as the '-' characters are not replaced with '_'. Changing the alert to:

alert(doc.SOAP-ENV__Envelope.xmlns__SOAP-ENV);

Results in an equation that does not work.

Changing ifwxml.js:784 from
return nm.replace(/:/gi, '__');
to
return nm.replace(/:/gi, '__').replace('-', '_');

makes it work as expected.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB