>the problem is this:
>
>I have two VFP cursor, in this example. Each of them with some fields.
>
>I need to generate an XML file with the two tables in it. The XML beed to be validated by a XSD schema (which is not under my control).
>
>I Create an XMLAdapater Object.
>Then I use the AddTableSchema Method to add the two tables to the XMLAdapter.
>Then I can easily use the diferent properties in the XMLAdapter object to personalize the Produced XML to my needs.
>
>I can then Produce the XML out of the XMLAdapater Object and this XML is exactly as it should be to validate.
>
>Well. It is not exactly. The Field Names tags are in LowerCase and the Schema enforces them to be in UpperCase.
>
>How do I do this ?
>
>TIA
Hi Francisco,
Here is a small example:
CLOSE DATABASES all
CLEAR
SET MEMOWIDTH TO 150
CREATE CURSOR foo (field1 I, field2 I, field3 I)
INSERT INTO foo VALUES (1,2,3)
LOCAL oXA as XMLAdapter, oXT as XMLTable, oXF as XMLField
oXA=CREATEOBJECT("XMLAdapter")
oXT=oXA.AddTableSchema("foo")
FOR I=1 TO oXT.Fields.Count
oXF=oXT.Fields.Item(1)
oXT.Fields.Remove(1)
oXF.XMLName=STRCONV(UPPER(oXF.Alias),5)
oXT.Fields.Add(oXF,oXF.XMLName)
NEXT
oXA.ToXML("cXML")
?cXML
return
Thanks,
Aleksey.