Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XML Adapter and xsd file
Message
De
30/08/2004 13:30:14
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, États-Unis
 
 
À
30/08/2004 02:18:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00937230
Message ID:
00937719
Vues:
13
Hi Aleksey,

Here is my code.
aa=NEWOBJECT("axml_order_list","axmladapter.prg")
aa.LoadXML(corderlist)
aa.tables[1].tocursor()
aa.savexml()

DEFINE CLASS axml_order_list AS aXmlAdapter

PROCEDURE Init
	this.XMLSchemaLocation="order_list.xsd"
ENDPROC

FUNCTION saveXml()
	LOCAL lcXml
	this.ReleaseXML 
	this.AddTableSchema(ALIAS())
	this.ToXML("lcXml")
	replace order_list.corderlist WITH lcXml IN order_list 

ENDFUNC
I set a break point before the toxml and XMLSchemaLocation did = "order_list.xsd"

Here is the xml generated.
<?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
<VFPDataSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="d:\projects\varient\client\order_list.xsd">
	<CR_ORDER>
		<norder>1</norder>
		<cflddesc>Last Name</cflddesc>
		<cascdesc>DESC</cascdesc>
		<cfldname>names.lastname</cfldname>
	</CR_ORDER>
	<CR_ORDER>
		<norder>2</norder>
		<cflddesc>First Name</cflddesc>
		<cascdesc>DESC</cascdesc>
		<cfldname>names.firstname</cfldname>
	</CR_ORDER>
</VFPDataSet>
>>
>>I tried that but is seems to add the full path even if I don't want it. Is there a way to define the schema as a memvar?
>>
>Hi James,
>
>What exactly have you tried?
>
>
>CLEAR
>SET MEMOWIDTH TO 150
>
>CREATE CURSOR foo (f1 I)
>
>LOCAL oXA as XMLAdapter
>
>oXA=CREATEOBJECT("XMLAdapter")
>oXA.AddTableSchema("foo")
>oXA.XMLSchemaLocation="test.xsd"
>
>oXA.ToXML("cXML",,.F.)
>?cXML
>?
>oXA.ToXML("cXML","test.xsd",.F.)
>?cXML
>
>RETURN
>
>
>Thanks,
>Aleksey.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform