Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XML DOM Not Working Right with FileToStr()
Message
From
04/04/2002 06:18:06
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00640665
Message ID:
00640764
Views:
32
>I am trying to get a binary file into my XML document from inside my VFP .prg and I think I am seeing an interface incompatibility. What do you think?
>
>Fails with
>"OLE IDispath exception code 0 from msxml4.dll: Error parsing 'RIFFp0 ' as bin.base64 datatype"
>
>I thought this was supposed to convert binary automatically to base64?
>
>
>
>
>oSendDoc =  CreateObject("Msxml2.FreeThreadedDOMDocument.4.0")
>oSendDoc.SetProperty("SelectionLanguage" , "XPath")
>oRootElement = oSendDoc.createElement("xml")
>oRoot = oRootElement
>oSendDoc.appendChild(oRoot)
>oXmlPI = oSendDoc.createProcessingInstruction("xml", "version='1.0'")
>oSendDoc.insertBefore(oXmlPI, oSendDoc.childNodes(0))
>oEnvElement = oSendDoc.createElement("envelope")
>oEnvElement.DataType = "bin.base64"
>oEnvElement.NodeTypedValue = FileToStr("c:\winnt\media\notify.wav")
>oRoot.appendChild( oEnvElement )
>oSendDoc.Save("it.xml")
>
Steve,
I don't think it'd automatically convert. You'd need to do conversion yourself. Hoping you have VFP7 a simplier way :
CREATE CURSOR myCursor (mydata m nocptrans)
APPEND BLANK
APPEND memo myData FROM "c:\Windows\media\notify.wav"
CURSORTOXML('myCursor','it.xml',1,512,0,'1')
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform