msxml6 - MSXML 6, User/PW Auth, ResolveExternals -
if 1 must load , parse xml resource user/pw-protected url cannot use msxml dom.load() far can tell. there no place specify credentials.
yet if use xmlhttprequest obtain , parse resource dom (via .responsexml property) have specify value .resolveexternals property.
this more or less works out when use msxml 3, 4, (or 5) defaults true, in msxml 6 defaults false:
in msxml 3.0, msxml 4.0, , msxml 5.0 default resolveexternals value true. in msxml 6.0, default setting false.
if property set false, no external includes , imports resolved.
is there way around not seeing? need externals resolved, when dealing xsds or wsdls.
or fooling myself, , perhaps .resolveexternals never applies when using xmlhttprequest (only dom.load() calls)?
have tried this?
xmlhttp.responsexml.resolveexternals = true; xmlhttp.responsexml.setproperty("prohibitdtd", false);
the thing solution may work msxml xmlhttp activex object.
edit: here concrete sample ie9:
var xmlhttp = new activexobject("msxml2.xmlhttp.6.0"); // var xmlhttp = new xmlhttprequest(); xmlhttp.open("get", "sample.xml", false); xmlhttp.responsexml.async = false; xmlhttp.responsexml.resolveexternals = true; xmlhttp.responsexml.validateonparse = false; xmlhttp.responsexml.setproperty("prohibitdtd", false); xmlhttp.onreadystatechange = function() { if (xmlhttp.readystate == 4 && xmlhttp.status == 200) { alert(xmlhttp.responsexml.xml); } } xmlhttp.send();
sample.xml
<!doctype data system "sample.dtd"><data>&ent;</data>
sample.dtd
<!entity ent "hello world!">
if run above cod ie9, you'll entity resolved. however, if switch commented out xmlhttprequest, fail.
ps: thought talking scripting inside ie, , there trident native component called xmlhttprequest quite different xmlhttp activex component. however, if referring ixmlhttprequest com interface residing in msxml6.dll, can translate above code c++ ease.
Comments
Post a Comment