Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursor to XML using existing xml schema XSD
Message
 
To
08/03/2002 11:08:26
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00629808
Message ID:
00630363
Views:
28
Bonnie,

I do not have XML file. Instead I am provided with a schema only. This schema is intended to be used as an output file structure definition. The output XML should be created from the cursor using the external schema only. (Then XML should be validated against the schema and sent outside).

Besides this I tried to use the approach you mentioned. Here are some limitations:
1. First of all the external party does not want to send any XML file, but the schema only.
2. I used an XML Viewer and created an XML from XSD/XDR schema files and then tried to recreate the replica of original XML. But XML Viewer as I have it, does not allow to interact programmatically. So, it is a question whether I can use this approach in the application. Besides this I was unable to create an exact XML replica. Actually cursortoxml() created the very same file as if I use the 'regular' dbf2xml VFP6 convertor (see "HOWTO: Convert FoxPro Cursor into XML Data Format (Q191758)").

Thank you for your interest

>Yuri,
>
>If you initially create your cursor with CURSORTOXML() and use your existing XML schema, then the resultant XML created with XMLTOCURSOR() should reflect your schema.
>
>I assume that you've tried it and it's not working correctly? Could you tell us what is happening?
>
>~~Bonnie
>
>
>
>>Mark,
>>
>>Thank you for the replay.
>>If you have a cursor, then CURSORTOXML() creates an XML and a schema that is internally generated for this XML. But what I need is quite different. I need either:
>>- if I have a cursor and an external schema (which I can not change), then how to generate a XML without replacing this schema, or;
>>- if I have a schema, then how to generate a suitable cursor that would be updated in VFP and then translated to XML keeping existing schema.
>>
>>
>>>I can create an xml doc. with a schema using VFP CURSORTOXML().
>>>
>>>Mark
>>>
>>>>Could anybody provide an example how to create a XML document from a cursor/table using existing xml Schema XSD file?
>>>>
>>>>For examle, there is a table:
>>>>testtable (author c(25), subject c(25), content M, dt_created T, cost n(10,3), currency c(20))
>>>>
>>>>And the schema is:
>>>>*-------------------------------------------
>>>>(?xml version="1.0"?>
>>>>
>>>>(Schema name="XMLTEST" xmlns="urn:schemas-microsoft-com:xml-data" (xmlns:dt="urn:schemas-microsoft-com:datatypes">
>>>>(description>
>>>> Describes the schema for direct data update .
>>>>(/description>
>>>>(ElementType name="author" content="textOnly" dt:type="string"/>
>>>>(ElementType name="subject" content="textOnly" dt:type="string"/>
>>>>(ElementType name="content" content="textOnly" dt:type="string"/>
>>>>(ElementType name="timeStamp" content="textOnly" dt:type="dateTime"/>
>>>>(ElementType name="currencyUnit" content="textOnly" dt:type="string"/>
>>>>(ElementType name="costValue" content="textOnly" dt:type="number"/>
>>>>(ElementType name="note" content="eltOnly">
>>>>(element type="author" minOccurs="1" maxOccurs="1"/>
>>>>(element type="subject" minOccurs="1" maxOccurs="1"/>
>>>>(element type="content" minOccurs="1" maxOccurs="1"/>
>>>>(element type="timeStamp" minOccurs="1" maxOccurs="1"/>
>>>>(/ElementType>
>>>>(ElementType name="Cost" content="eltOnly">
>>>>(element type="currencyUnit" minOccurs="1" maxOccurs="1"/>
>>>>(element type="costValue" minOccurs="1" maxOccurs="1"/>
>>>>(/ElementType>
>>>>(/Schema>
>>>>*----Please replace starting "(" with "<" above.
>>>>*Sorry, entire message is not displayed otherwise.--------------------
>>>>
>>>>I will appreciate any input or advice
Previous
Reply
Map
View

Click here to load this message in the networking platform