msxml

Can I do an async XML call in Excel 2010 VBA?

拟墨画扇 提交于 2019-12-08 10:13:41
问题 In my spreadsheet I have a reference to the MS XML v3 library. Here is my sample code Option Explicit Private objConn As XMLHTTP30 Public Sub HandleAsyncEvent() Debug.Print "Done" End Sub Public Function InitService(serviceUrl As String, Optional asyncMode As Boolean = True) Set objConn = New XMLHTTP30 objConn.Open "POST", serviceUrl, asyncMode objConn.setRequestHeader "Content-Type", "text/xml" objConn.onreadystatechange = HandleAsyncEvent End Function I encountered a runtime exception when

Saving a IXMLDOMDocument without end tag

人走茶凉 提交于 2019-12-08 06:21:16
问题 Using MSXML via C++, when I call IXMLDOMDocument::save , empty XML elements will get an end tag, like this: <root> <child name="first"> </child> </root> But I want it saved as this: <root> <child name="first" /> </root> What do I need to do to accomplish that? 回答1: DOM itself does that if there are no child nodes but I don't know why in your case it is doing like this. If you want to do explicitly call Pretty Print on the DOM pointer. #include <msxml2.h> bool FormatDOMDocument

Saving a IXMLDOMDocument without end tag

♀尐吖头ヾ 提交于 2019-12-08 03:21:27
Using MSXML via C++, when I call IXMLDOMDocument::save , empty XML elements will get an end tag, like this: <root> <child name="first"> </child> </root> But I want it saved as this: <root> <child name="first" /> </root> What do I need to do to accomplish that? DOM itself does that if there are no child nodes but I don't know why in your case it is doing like this. If you want to do explicitly call Pretty Print on the DOM pointer. #include <msxml2.h> bool FormatDOMDocument (IXMLDOMDocument *pDoc, IStream *pStream) { // Create the writer CComPtr <IMXWriter> pMXWriter; if (FAILED (pMXWriter

EOutOfMemory Creating Large XML Using Delphi

邮差的信 提交于 2019-12-06 09:26:00
I'm using Delphi to create an XML document from data in a relational database. It tests fine with small datasets, but when I try to expand the size of the data set to production levels it eventually bombs out with an EOutOfMemory exception during node creation. I'm using a TXMLDocument dropped on a form (MSXML as the Vendor), and my code generally looks like this: DS := GetDS(Conn, 'SELECT Fields. . . FROM Table WHERE InsuredID = ' +IntToStr(AInsuredID)); try while not DS.Eof do with ANode.AddChild('LE') do begin AddChild('LEProvider').Text := DS.FieldByName('LEProvider').AsString; // Need to

How to declare a user-defined function returning node-set?

痞子三分冷 提交于 2019-12-06 05:31:43
问题 I want something like this: <msxsl:script language="C#"> ??? getNodes() { ... return ... } </msxsl:script> <xsl:for-each select="user:getNodes()"> ... </xsl:for-each> What return type should i use for getNodes() and what should i put in it's body? 回答1: In principle you need to use the XPathNodeIterator to return node sets (as Samjudson says). I take it that the example you gave is a degenerated function, as you do not supply it with any parameters. However, I think it is instructive the see

When does XPath property have to be set to XML DOM object?

六月ゝ 毕业季﹏ 提交于 2019-12-06 02:13:06
For example: Set objXML = CreateObject("Microsoft.XMLDOM") objXML.async = False objXML.validateOnParse = False objXML.resolveExternals = False objXML.load("http://www.w3schools.com/dom/books.xml") 'objXML.setProperty "SelectionLanguage", "XPath" For Each x In objXML.selectNodes("//book[@category='cooking' and @category='children']") WScript.Echo x.text Next For Each y In objXML.selectNodes("//book[position()<3]") WScript.Echo y.text Next When objXML.setProperty "SelectionLanguage", "XPath" is commented then first xpath expression (x object) is returned valid but second xpath expression (y

How to VBA callback function when XMLHTTP onTimeOut?

半城伤御伤魂 提交于 2019-12-05 20:29:36
问题 I'm trying get xml data from webserver to excel, then I wrote a sendRequest function to call in excel =sendRequest("http://abb.com/index.php?id=111") When web-server having trouble, cannot connect or cannot find, excel is not responding, it was horrible! To avoid it, i think we should set timeOut. These are my function: Function sendRequest(Url) 'Call service Set XMLHTTP = CreateObject("Msxml2.ServerXMLHTTP.6.0") 'Timeout values are in milli-seconds lResolve = 10 * 1000 lConnect = 10 * 1000

Find MSXML version from registry

倖福魔咒の 提交于 2019-12-05 03:09:01
windows has many MSXML versions that can be installed side by side. i.e ver 3, 4, 5 & 6. I have to find which msxml file is present on the system. My query is limited through registry only. Anarah All of the MSXML versions installed on your machine will be in the following registry GUID: HKEY_CLASSES_ROOT\CLSID\{2933BF90-7B36-11D2-B20E-00C04F983E60}\VersionList. If you are looking for a specific version, say 3.0, you would check that Name = 3.0. Getting you all versions installed via Powershell: New-PSDrive -PSProvider registry -Root HKEY_CLASSES_ROOT -Name HKCR get-item "HKCR:\CLSID\{2933BF90

Sending a 'application/soap+xml' SOAP request using Classic ASP

你离开我真会死。 提交于 2019-12-05 02:59:30
问题 Any help with this would be appreciated; I've been at it for a few days now. Below is the code that I've got so far; unfortunatly when I run it I get a HTTP 415 error; Cannot process the message because the content type 'text/xml; charset=UTF-8' was not the expected type 'application/soap+xml; charset=utf-8' . I have to send the content-type of application/soap+xml as this is the only type that the web service allows; and I have to do it in classic ASP. I've tried changing the 'send' line to

How to get equivalent of max() on MSXML6?

对着背影说爱祢 提交于 2019-12-04 20:32:10
Evidently MSXML6 doesn't support XSLT 2.0, at least not the max() function. I need to find out the node that contains the highest value among its siblings. They are in arbitrary order. I want the order to remain identical so adding order-by and checking [0] is out of question. I want to do this with a single XPath statement. I don't want to call templates or involve any more complex logic than that. I'm sure there is a horrifying MS Scripting Extensions embedded somewhere. Eww. I thought of: elem1[count(../elem1[@value < current()/@value]) = 0] But it didn't work as I expected (returns the