Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hierarchal XML
Message
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Title:
Hierarchal XML
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00978739
Message ID:
00978739
Views:
44
Hello all,

Is it possible using the xmlAdapter Class to output heirarchal XML from vfp cursors (or tables) such as something like this ?
	oXML = CREA("xmlAdapter")

	SELECT * FROM condoCatalog WHERE LEFT(NAME,1)="B" INTO TABLE x_Condos
	INDEX ON id TAG id 
	
	SELECT * FROM Condobuildings ;
		inner JOIN x_Condos ;
		ON condo_id = x_Condos.ID ;
		INTO TABLE x_CondosBuildings

	CREATE DATABASE dbc_Temp
	SET DATABASE TO dbc_Temp

	USE IN x_Condos
	USE IN x_CondosBuildings

	ADD TABLE x_Condos
	ADD TABLE x_CondosBuildings

	ALTER TABLE x_Condos ADD PRIMARY KEY id TAG id

	ALTER TABLE x_CondosBuildings  ;
		ADD FOREIGN KEY condo_id TAG ;
		condo_id REFERENCES x_Condos TAG ID


	oXML.ADDTABLESCHEMA("x_Condos")
	oXML.ADDTABLESCHEMA("x_CondosBuildings")


	oXML.UTF8ENCODED     = .T.		&& cursor contains international characters
	oXML.ISDIFFGRAM      = .F.		&& Generate an XML DiffGram
	lcSchemaLocation = ''		&& Our schema is inline
	llIsFile         = .F.		&& Our XML is a stream
	llIncludeBefore  = .T.		&& Include <diffgram:before> format
	llChangesOnly    = .F.		&& Generate only changes we made
	oXML.TOXML('lcXML', lcSchemaLocation, llIsFile, llIncludeBefore, llChangesOnly)

	STRTOFILE( lcXML , "greg.xml" )
	MODIFY FILE "greg.xml"
I tried setting relationships between the two tables, tried putting them in a dbc and setting a persistent relationship ??? Does anyone know how to tell the xmlAdapter object to output the two tables as a heirarchal relationship and how to tell it what the relationship is based on ?

Is this even possible ?

Everything I tried just output the first table's records then the next table....

TIA
Greg Foote
Software At Work, Inc.
Next
Reply
Map
View

Click here to load this message in the networking platform