sorry to say, but the TW3HttpRequest / TW3Storage combination seems to be rather untested (see also my other post concerning LoadBinary below)...
property ResponseXML:string read (handle.responseXML);
is wrong > it should be
property ResponseXML: JDocument read (handle.responseXML);
because otherwise we'll never get the Document-Object back (only ever a string)...
One more suggestion:
class procedure TW3Storage.LoadXML()
fails to "force" the request to always be loaded as XML/Document > only if the server sends Content-Type header as "text/xml" or "application/xml" ResponseXML (see above) will be filled at all (not, if the server fails to detect the type (e.g. if served with a different extension)?
Therefore class procedure TW3Storage.LoadXML() should get a line:
next potential problem is that ResponseXML is of type JDocument - not of type JXMLDocument (which seems to be unsupported anyway everywhere)!
Therefore I'd suggest to add/replace (for /in SmartCL.FileUtils):
TW3XMLDocumentReadyEvent = procedure(Sender:TW3HttpRequest; ADocument: JDocument);
and deprecate LoadXML!
ps: probably for some historic reasons
property Handle read ( Variant(FReqObj) )
are both included in TW3HttpRequest...
My 2 cents: I think this should be clarified (remove Element? - where is this name coming from anyway - and retype Handle from THandle(=Variant) to JXMLHttpRequest > (ab)using THandle/ Variant just "serves" to remove all (type-/spelling) checks in this case!).
class procedure TW3Storage.LoadXML() does NOT include exception handling around mLoader.Get(), class procedure TW3Storage.LoadFile however DOES include it?! ...even more inconsistencies (I don't know which one is right)?!