Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating an XML String to be returned by a VFP COM Serve
Message
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Miscellaneous
Thread ID:
00725158
Message ID:
00725246
Views:
9
This message has been marked as the solution to the initial question of the thread.
You may refer to the 'XML' property for it's XML representation of the node and all its descendants.
*&  from your example.
*&
loOutput = CreateObject( "MSXML2.DOMDocument.3.0" )
*** now i should use .AppendChild() or the like of loOutput to
*** fill in the xml object.
*&
*&  Add this line to get the XML raw text.
lcOutputXML = loOutput.documentElement.XML
*&
>Here is some code from my com app:
>PROCEDURE GetCars( InXml as String ) AS String
>LOCAL lcReturn, loXML, loRoot, loElement
>LOCAL loOutput, loOutRoot, loOutElement
>		
>LOCAL lOpCode, lCountry
>
>lcReturn = "test"
>*** fills in the xml with the InXml param.
>loXML = CREATEOBJECT( "MSXML2.DOMDocument.3.0" )
>loXML.loadXML( InXml )
>loRoot = loXML.documentElement
>*** then i loop through the nodes of loRoot, and do some stuff with it
>*** the result of that stuff should be appended to some new xml string
>
>loOutput = CreateObject( "MSXML2.DOMDocument.3.0" )
>*** now i should use .AppendChild() or the like of loOutput to
>*** fill in the xml object.
>
>I know i could then use loOutput.Save method to save the xml into a file and then RETURN (FileToStr(thexml.xml)), but that's what i want to avoid. How can i return the xml as a string?
>
>Jaime
>
>>Depends on how big your XML string is going to be. If less than 64K, just build the a character text string using a memory variable.
>>
>>Hope that helps (or do I not fully grasp the problem?)
>>
>>
>>>Hi All
>>>Here is the scenario. I have an ASP page that receives as param. an XML string, calls a VFP COM that does some work on it and returns a new XML. This newly created XML is then sent back by the ASP.
>>>The ASP part works well. It basically runs something like
>>>MyVFPCom( xmlIn, xmlOut )
>>>Response.Write( xmlOut )
>>>My problem is with the creation of the xmlOut string. How do i create it? I would like to avoid having to create a .xml file then send the FILETOSTR of the file, but rather just work on memory.
>>>So, how can i create the XML string from the MyVFPCom?
>>>
>>>TIA
>>>Jaime
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform