At the end, I just find the solution. Somebody may need:

If XML gotten from asmx web service has schema part and data part, and you need 
to convert it to Vfp cursor: You must set oXml.XmlName property with header of 
data part.
Without this, cursor is created according to schema but empty.

Local oXml
oXml = NewObject("xmladapter")
oXml.LoadXml(('D:\mkys\xml\ntKodGet2.xml', .T.)

oXml.XmlName = StrConv(strConv('DocumentElement',1),5)

oXml.Tables(1).ToCursor()

Ali Ihsan

-----Original Message-----
From: [email protected] [mailto:[email protected]] On 
Behalf Of Rafael Copquin
Sent: Monday, October 26, 2009 1:37 PM
To: [email protected]
Subject: Re: XMLAdapter vfp9

With these statements you create a XML adapter and populate it with two 
cursors:

oXML=CreateObject('XmlAdapter')
oXML.AddTableSchema('curWeeks')
oXML.AddTableSchema('curSemanas')
oXML.ToXML('cXML')


You can send the cXML variable to another form, with a private data session 
thus:

do form form2 with cXML


with these statetements you retrieve the two cursors from the XML adapter, 
but in form2

** init event form 2

lparameters tcXML

local cXML

cXML = tcXML

oXML=CreateObject('XmlAdapter')
oXML.LoadXML(cXML)
oXML.Tables.Item(1).ToCursor()  && name of the first cursor ie: curWeeks
oXML.Tables.Item(2).ToCursor()  && name of the second cursor ie: curSemanas

the above are taken from an actual application I am just building

Be careful, pay attention to the quote marks and how to use them. In the 
first snippet, you use the quotes and create the xml variable (cXML).
In the second snippet, you use the variable cXML, but without the quotes.

Regards

Rafael Copquin




----- Original Message ----- 
From: "Ali İhsan Türkoğlu" <[email protected]>
To: <[email protected]>
Sent: Sunday, October 25, 2009 1:25 AM
Subject: RE: XMLAdapter vfp9


> Mr. Russell,
> Sorry for my poor english. I don't understand what you mean.
>
> My question is: Although xml file has 4 records, I can not get them with 
> xmladapter.
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] 
> On Behalf Of Stephen Russell
> Sent: Saturday, October 24, 2009 10:30 PM
> To: [email protected]
> Subject: Re: XMLAdapter vfp9
>
> You may need to populate this XML obj and then use it to run a query
> that will give you data.
>
> Sent from my iPhone
> Stephen Russell
> 901.246-0159
>
>
> On Oct 24, 2009, at 2:51 PM, Ali İhsan Türkoğlu <[email protected]>
> wrote:
>
>> I can get only an empty cursor from this xml.
>>
>> What is missing?
>>
>>
>>
>> My code is:
>>
>>
>>
>> public oXMLAdapter AS XMLADAPTER
>>
>> oXMLAdapter = NEWOBJECT('XMLAdapter')
>>
>> oXMLAdapter.LOADXML('D:\mkys\xml\ntKodGet2.xml', .T.)
>>
>> ?oXMLAdapter.tables.Count     && prints 1
>>
>> oXMLAdapter.tables(1).ToCursor()    && kod cursor is created just
>> defined in
>> schema but, EMPTY !!!
>>
>>
>>
>>
>>
>> My XML is:
>>
>>
>>
>> <?xml version="1.0" encoding="utf-8"?>
>>
>>                                   <ntKodGetResult>
>>
>>                                               <xs:schema
>> id="NewDataSet"
>> xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema";
>> xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
>>
>>                                                           <xs:element
>> name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="kod"
>> msdata:UseCurrentLocale="true">
>>
>>
>> <xs:complexType>
>>
>>
>> <xs:choice minOccurs="0" maxOccurs="unbounded">
>>
>>
>> <xs:element name="kod">
>>
>>
>> <xs:complexType>
>>
>>
>> <xs:sequence>
>>
>>
>> <xs:element name="KOD_ID" type="xs:long" minOccurs="0"/>
>>
>>
>> <xs:element name="KOD_ADI" type="xs:string" minOccurs="0"/>
>>
>>
>> <xs:element name="DEGER" type="xs:string" minOccurs="0"/>
>>
>>
>> <xs:element name="TANIM" type="xs:string" minOccurs="0"/>
>>
>>
>> <xs:element name="ACIKLAMA" type="xs:string" minOccurs="0"/>
>>
>>
>> <xs:element name="AKTIF" type="xs:string" minOccurs="0"/>
>>
>>
>> </xs:sequence>
>>
>>
>> </xs:complexType>
>>
>>
>> </xs:element>
>>
>>
>> </xs:choice>
>>
>>
>> </xs:complexType>
>>
>>                                                           </
>> xs:element>
>>
>>                                               </xs:schema>
>>
>>                                               <diffgr:diffgram
>> xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
>> xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
>>
>>
>> <DocumentElement
>> xmlns="">
>>
>>
>>
>> <kod
>> diffgr:id="kod1" msdata:rowOrder="0">
>>
>>
>> <KOD_ID>8893</KOD_ID>
>>
>>
>> <KOD_ADI>TASINIR_HAREKET_TURU</KOD_ADI>
>>
>>
>> <DEGER>C1</DEGER>
>>
>>
>> <TANIM>DEVİR- AMBARLAR ARASI DEVİR</TANIM>
>>
>>
>> <ACIKLAMA>Taşınır Hareket Türleri</ACIKLAMA>
>>
>>
>> <AKTIF>E</AKTIF>
>>
>>
>> </kod>
>>
>>
>>
>> <kod
>> diffgr:id="kod2" msdata:rowOrder="1">
>>
>>
>> <KOD_ID>8894</KOD_ID>
>>
>>
>> <KOD_ADI>TASINIR_HAREKET_TURU</KOD_ADI>
>>
>>
>> <DEGER>C2</DEGER>
>>
>>
>> <TANIM>FİRE, ZAYİAT</TANIM>
>>
>>
>> <ACIKLAMA>Taşınır Hareket Türleri</ACIKLAMA>
>>
>>
>> <AKTIF>E</AKTIF>
>>
>>
>> </kod>
>>
>>
>>
>> <kod
>> diffgr:id="kod3" msdata:rowOrder="2">
>>
>>
>> <KOD_ID>8895</KOD_ID>
>>
>>
>> <KOD_ADI>TASINIR_HAREKET_TURU</KOD_ADI>
>>
>>
>> <DEGER>C3</DEGER>
>>
>>
>> <TANIM>DEVİR-DİĞER BİRİMLERE ÇIKIŞ</TANIM>
>>
>>
>> <ACIKLAMA>Taşınır Hareket Türleri</ACIKLAMA>
>>
>>
>> <AKTIF>E</AKTIF>
>>
>>
>> </kod>
>>
>>
>>
>> <kod
>> diffgr:id="kod4" msdata:rowOrder="3">
>>
>>
>> <KOD_ID>8896</KOD_ID>
>>
>>
>> <KOD_ADI>TASINIR_HAREKET_TURU</KOD_ADI>
>>
>>
>> <DEGER>C4</DEGER>
>>
>>
>> <TANIM>TÜKETİM</TANIM>
>>
>>
>> <ACIKLAMA>Taşınır Hareket Türleri</ACIKLAMA>
>>
>>
>> <AKTIF>E</AKTIF>
>>
>>
>> </kod>
>>
>>
>> </DocumentElement>
>>
>>                                               </diffgr:diffgram>
>>
>>                                   </ntKodGetResult>
>>
>>
>>
>>
>>
>> --- StripMime Report -- processed MIME parts ---
>> multipart/alternative
>>  text/plain (text body -- kept)
>>  text/html
>> ---
>>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/000301ca84b0$85d611f0$918235...@com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to