Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Toxml method question
Message
From
06/01/2007 12:10:43
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01183153
Message ID:
01183157
Views:
23
This message has been marked as the solution to the initial question of the thread.
>This is hopefully a simple question:
>
>I am trying to create a nested XML file from two cursors. The relations are set, the nesting works fine. How can I change the VFPDataSet to another name and how do I remove all the xds schema information without having to strip it manually?
>
>Thanks in advance!

You can specify XMLName and XMLSchemaLocation. ie:
CLOSE DATABASES all
USE _samples+"\data\customer" IN 0
USE _samples+"\data\orders" IN 0 ORDER tag cust_id
USE _samples+"\data\orditems" IN 0 ORDER tag order_id
SET RELATION TO order_id INTO 'orditems' IN 'orders'
SET RELATION TO cust_id INTO 'orders' IN 'customer'

LOCAL oAdapter as XMLAdapter
oAdapter = CREATEOBJECT('xmlAdapter')
oAdapter.RespectNesting = .t.
oAdapter.XMLName=STRCONV('MyNameInsteadOfVFPDataSet',12)
oAdapter.AddTableSchema('customer',.f.)
oAdapter.AddTableSchema('orders',.f.)
oAdapter.AddTableSchema('orditems',.f.)
oAdapter.XMLSchemaLocation = 'myExternalsSchema.xsd'

oAdapter.ToXML('mynested.xml','',.t.)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform