Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Transferência de dados entre camadas
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Divers
Thread ID:
00862615
Message ID:
00862832
Vues:
16
This message has been marked as the solution to the initial question of the thread.
>Eu também acabei de ler o livro do Fábio neste último final de semana... (Aliás, parabéns Fábio, belo trabalho!)
>
>Não fiz testes na prática, mas se entendi bem o que li, vc pode usar a classe XMLAdapter e passar quantas tabelas quiser... Esta classe, diferentemente da função CursorToXml(), permite adicionarmos mais de uma tabela e gerar apenas uma string XML compativel com o recordset do Ado.Net (Certo fábio? - hehehe)
>
>Estou em um cliente e sem o livro em mãos... Então não vou conseguir montar um código de exemplo para você... Mas de uma pesquisada no capítulo do livro que fala sobre esta classe (XMLAdapter) que você encontrará o que está procurando.


Rodolfo:

Não li o livro do Fábio, mais é certo que o XMLAdapter pode usar mais de uma tabela.
Algo asi como:
Close Tables all
Use tabela1
Use tabela2 In 0

Local oXA as XMLAdapter
oXA = NewObject("XMLAdapter")
oXA.WrapMemoInCDATA = .T.
oXA.WrapCharInCDATA = .F.
oXA.IsDiffgram = .f.
oXA.AddTableSchema("tabela1",.t.)
oXA.AddTableSchema("tabela2",.t.)

oXA.ToXML("c:\temp\myxmlfile.xml",,.T.)
oXA.ReleaseXML(.t.)


* ler dados XML recevidos
Local oXA2 as XMLAdapter
oXA2 = NewObject("xmladapter")
*oXA2.XMLSchemaLocation='c:\temp\myxmlfile.xsd'
oXA2.LoadXML("c:\temp\myxmlfile.xml",.T.,.T.)
Close Tables all
For i = 1 to oXA2.tables.Count
	oXA2.Tables.Item(i).ToCursor()
EndFor
oXA2.ReleaseXML(.t.)
Espero seja de ajuda.


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform