>>>In IE 5.5 I have a XML data island.
>>>I want to convert it to XML string.
>>>However, the following program does'nt work since objADOStream is undefined.
>>>How to convert ADO recordset to XML string in jscript ?
>>>
>>>
>>>result.recordset.MoveFirst();
>>>var objADOStream;
>>>result.recordset.save( objADOStream, 1); //1=adPersistXML
>>>document.frmdoc.RowData.value = objADOStream.ReadText(-1); //-1=adReadAll
>>>
>>
>>Actually, if the reference to
result is the XML data island you can get to the XML source by accessing its XML property, as in
result.XML.
>>
>>And in your code, I think you would need to instantiate the ADO stream object first before trying to save the contents of the recordset to it. But that is unnecessary if you are trying to get to the XML source.
>
>Thank you for the reply.
>I tried it, but have found that if I have a date type in xml data island,
>recordset save() method produces unspecified error message, for example using the data:
>
><datefield dt:dt="date"/>
>
>Also, If I add records to recordset, will the result.XML property contain also the changed rows ?
>
>I tried to convert a xml string from .save() method to foxpro cursor using
>Visual FoxPro XMLToCursor() function. However an error "invalid width on decimal places" during call XMLToCursor(). Is it possible to use this function?
How are you retrieving the data island?
The data island is basically an XMLDocument object and you can refer to it either way. So the XML and the recordset should both have the same data.
Take a look at this article at devx for some examples :
http://gethelp.devx.com/techtips/dhtml_pro/10min/10min0501/td051501-1.aspAs far as converting that to a VFP cursor, look at the alternative (and free) wwXML class downloadable from
www.west-wind.com.
HTH