Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use wwXML.XMLToCursor()
Message
General information
Forum:
Internet
Category:
XML
Title:
How to use wwXML.XMLToCursor()
Miscellaneous
Thread ID:
00495751
Message ID:
00495751
Views:
35
Ok ! I am new with XML. This is what I did to export two tables ( parent and child) to XML with wwxml class. My XML is created OK.
	oXML = CREATEOBJECT('wwXML')
	oXML.lCreateDataStructure = .t. && Schema

	*** Create the DTDs for the two tables
	select CDefFile
	lcDTD1 = oXML.CreateDataStructureDTD('DefFile','Row_Def')

	select CFiche
	lcDTD2 = oXML.CreateDataStructureDTD('Fiche','Row_Fch')

	*** Create the full DTD
	lcDTD = '<!DOCTYPE LowLevel [' + CR +;
		'<!ELEMENT LowLevel (DefFile,Fiche)>' + CR + ;
		lcDTD1 + lcDTD2 + ;
		']>'

	*** Add the root node manually
	lcOutput = '<LowLevel>' +CR

	*** Now create the data XML
	Sele CDefFile
	lcOutput = lcOutput + oXML.CreateCursorXML('DefFile','Row_Def',2)

	select CFiche
	lcOutput = lcOutput + oXML.CreateCursorXML('Fiche','Row_Fch',2)

	*** Must add XML header and add the closing DocRoot element
	lcOutput = [<?xml version='1.0'?>] + CR +;
		lcDTD + ;
		CR + lcOutput + ;
		'</LowLevel>'


	*** Show it
	Strtofile(lcOutput,tcXMLFIle)
Now How do I restore the two Cursor? Do I use XMLToCursor or I have to split the XML file in two?
Reply
Map
View

Click here to load this message in the networking platform