XmlUpdatefram Function |
Note |
---|
To use XMLUpdateGRAM( ), you must use Set MultiLocks ON and enable table buffering. |
Note |
---|
Before calling XMLUpdateGRAM( ), you should specify the key field list by calling CursorSetProp( ) with the KeyFieldList property against existing cursors and tables. If you do not specify key fields, both the before and after representations contains all the fields in the table. If you specify one or more key fields, only those fields appear in the before section. |
Namespace: XSharp.VFP
Note |
---|
You must supply the mapping schema. |
1<ROOT xmlns:updg="urn:schemas-microsoft-com:xml-updategram"> 2<updg:sync mapping-schema="mySchema.xsd" > 3<updg:before>
Note |
---|
To use the X# OLE DB Provider with XMLUpdateGRAM( ), you must install MSXML 3.0 on the computer with the OLE DB Provider. |
1Set MultiLocks ON 2Create CURSOR Test (mField M, cField I AutoInc) 3Insert Into Test (mField) VALUES ("123456789") 4Insert Into Test (mField) VALUES ("23456789") 5Insert Into Test (mField) VALUES ("3456789") 6Insert Into Test (mField) VALUES ("456789") 7CursorSetProp("Buffering",5) 8CursorSetProp("keyfieldlist",'cField') 9Update Test Set mField = "XXXXXXX" Where cField < 3 10StrToFile(XMLUpdateGRAM(),'xmlupdate.txt') 11MODIFY FILE xmlupdate.txt 12RETURN
1Select OrderID, CustID, NTOM(Total_Price) as Total_Price; 2From Orders Into CURSOR New_Orders READWRITE 3CursorSetProp("Buffering", 5, "New_Orders") 4Replace Total_Price WITH (Total_Price * 1.083) 5cXMLUpdg = XMLUpdateGRAM("New_Orders")
Flag 16 | Flag 32 | Flag 32768 is Set |
Not set | Not set | XML documents: Window-1252. Unicode data: code page 1252. Character data: default code page, unless a field is marked as NOCPTRANS. |
True (.T) | Not set |
XML documents: Plus-CodePage property of the cursor. If XMLField CodePage property is greater than zero (0)
and it doesn’t match the cursor’s code page, an error is reported. Unicode data: the Code page property of the cursor object. Character data: none. Raw data from the X# tables (.dbf) are used instead. |
Not set | Set |
XML documents: UTF-8 code page. Unicode data: UTF-8 code page. Character data: Default code page unless field is marked as NOCPTRANS, in which case no additional character translation to UTF-8 occurs. |
Set | Set |
XML documents: UTF-8 code page. Unicode data: UTF-8 code page. Character data: default code page unless a field is marked as NOCPTRANS, in which case the data are translated to UTF-8 using the SYS(3005) setting. |
Flag 16 | Flag 32 | Without the 32768 flag |
Not set | Not set |
XML documents: Window-1252. Unicode data: code page 1252. Character data: default code page unless a field is marked as NOCPTRANS. |
True (.T) | Not set | XML documents: CodePage property of the cursor. Character data: none. Raw data from the X# tables (.dbf) are used instead. Unicode data: code page property of the cursor object. |
Not set | Set | XML documents: UTF-8 code page. Unicode data: UTF-8 code page. Character data: default code page unless field is marked as NOCPTRANS, in which case no additional character translation to UTF-8 occurs. |
Set | Set |
XML documents: UTF-8 code page. Unicode data: UTF-8 code page. Character data: default code page unless field is marked as NOCPTRANS, in which case, they are translated to UTF-8 using code page for the current SYS(3005) setting. |
nFlag | Bit | Output description |
---|---|---|
0 | 0000 | (Default) Use UTF-8 formatted XML. |
1 | 0001 | Use unformatted, for example, continuous string XML. |
2 | 0010 | Enclose empty elements with both open and closing elements, for example, <cc04><cc04/>. |
4 | 0100 | Preserve white space in fields. |
8 | 1000 | Wrap Memo fields in CDATA sections. |
16 | 10000 | Output encoding. |
32 | 100000 | Output encoding. |
32768 | none | Indicates that a code page should be used. |
Note |
---|
When output encoding is UTF-8 (default), the XML Declaration does not contain an Encoding= attribute (no encoding attribute = UTF-8). |
Note |
---|
Encoding flags are set by combining bits 4 and 5 (0010000). |
Encoding flag | Bits 4 and 5 | Description |
---|---|---|
+0 | 00 | (Default) Windows 1252 |
+16 | 01 | Set output encoding attribute to the code page of the cursor. |
+32 | 10 | Set output encoding attribute to UTF-8 (no character translation). |
+48 | 11 | Set output encoding attribute to UTF-8 and translate double-byte characters to UTF-8. |