Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CURSORTOXML Question (warning - long message)
Message
De
05/06/2002 22:10:26
Mike Sue-Ping
Cambridge, Ontario, Canada
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
CURSORTOXML Question (warning - long message)
Divers
Thread ID:
00665239
Message ID:
00665239
Vues:
54
I have seen some HTML using VB Script with an ActiveX grid control (Beegrid) that can access data from an xml file. It's syntax is simple and is as follows:
Sub OpenRecordset()
	dim rs,sFileName
	const adOpenKeyset = 1
	const adOpenForwardOnly = 0	

	on error resume next
	
	sFileName = "myXMLfile.xml"

	set rs = CreateObject("ADODB.Recordset")
	rs.Open sFileName

	Set SGGrid1.DataSource = rs
	set rs=nothing
End Sub
Some of the XML from the file is shown below:
<xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
	xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
	xmlns:rs='urn:schemas-microsoft-com:rowset'
	xmlns:z='#RowsetSchema'>
<s:Schema id='RowsetSchema'>
	<s:ElementType name='row' content='eltOnly' rs:updatable='true'>
		<s:AttributeType name='Flag' rs:number='1' rs:nullable='true' rs:maydefer='true' rs:write='true'>
			<s:datatype dt:type='bin.hex' dt:maxLength='1073741824' rs:long='true'/>
		</s:AttributeType>
		<s:AttributeType name='Region' rs:number='2' rs:nullable='true' rs:maydefer='true' rs:write='true'>
			<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='SubRegion' rs:number='3' rs:nullable='true' rs:maydefer='true' rs:write='true'>
			<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='Country' rs:number='4' rs:nullable='true' rs:maydefer='true' rs:write='true'>
			<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='Capital' rs:number='5' rs:nullable='true' rs:maydefer='true' rs:write='true'>
			<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='Currency' rs:number='6' rs:nullable='true' rs:maydefer='true' rs:write='true'>
			<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='255'/>
		</s:AttributeType>
		<s:AttributeType name='Languages' rs:number='7' rs:nullable='true' rs:maydefer='true' rs:write='true'>
			<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='Code' rs:number='8' rs:nullable='true' rs:maydefer='true' rs:write='true'>
			<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='3'/>
		</s:AttributeType>
		<s:AttributeType name='OfficialName' rs:number='9' rs:nullable='true' rs:maydefer='true' rs:write='true'>
			<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='255'/>
		</s:AttributeType>
		<s:AttributeType name='Area' rs:number='10' rs:nullable='true' rs:maydefer='true' rs:write='true'>
			<s:datatype dt:type='r4' dt:maxLength='4' rs:precision='7' rs:fixedlength='true'/>
		</s:AttributeType>
		<s:AttributeType name='GDP' rs:number='11' rs:nullable='true' rs:maydefer='true' rs:write='true'>
			<s:datatype dt:type='i8' rs:dbtype='currency' dt:maxLength='8' rs:precision='19' rs:fixedlength='true'/>
		</s:AttributeType>
		<s:AttributeType name='Population' rs:number='12' rs:nullable='true' rs:maydefer='true' rs:write='true'>
			<s:datatype dt:type='int' dt:maxLength='4' rs:precision='10' rs:fixedlength='true'/>
		</s:AttributeType>
		<s:AttributeType name='Religions' rs:number='13' rs:nullable='true' rs:maydefer='true' rs:write='true'>
			<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='255'/>
		</s:AttributeType>
		<s:extends type='rs:rowbase'/>
	</s:ElementType>
</s:Schema>
<rs:data>
	<z:row Flag='424d360300000000000036000000280000001000000010000000010018000000000000030000000000000000000000
		00000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
		ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00840000840000
		84000084000084000084000084000084000084000084000000ff0000ff0000000000000000ff0000ff0084000084000084000084000084
		000084000084000084000084000084000000ff0000ff0000000000000000ff0000ff008400008400008400008400008400008400008400
		0084000084000084000000ff0000ff0000000000000000ff0000ff00840000840000840000840000840000840000840000840000840000
		84000000ff0000ff0000000000000000ff0000ff0084000084000084000084000084000084000084000084000084000084000000ff0000
		ff0000000000000000ff0000ff0084000084000084000084000084000084000084000084000084000084000000ff0000ff000000000000
		0000ff0000ff0084000084000084000084000084000084000084000084000084000084000000ff0000ff0000000000000000ff0000ff00
		84000084000084000084000084000084000084000084000084000084000084000084000084000084000084000084000084000084000084
		00008400008400008400008400008400008400008400008400008400008400008400008400008400008400008400008400008400008400
		0084000084000084000084000084000084000084000000ff0000ff0000ff00840000840000840000840000840000840000840000840000
		84000084000084000000ff0000ff0084000084000000ff0084840084000084000084000084000084000084000084000084000084000084
		00008400008400008400008400008400008400ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
		ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
		ffffffffff00000000' Region='Africa' SubRegion='Eastern Africa' Country='Zambia' Capital='Lusaka' Currency='Zambian Kwacha'
		 Languages='English (official), local dialects' Code='ZMB' OfficialName='Republic of Zambia' Area='743.40002'
		 GDP='455' Population='9872000' Religions='Christian, Muslim, traditional beliefs'/>
My question is (finally), how can I make VFP's CURSORTOXML() produce output like the above. I've been playing with the function and can't seem to make it do this.

TIA

Mike.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform