XMLUPDATEGRAM( ) Function

Mirrors changes made in a buffered table or cursor to an XML UpdateGram.

XMLUPDATEGRAM( [cAliasList [, nFlags]])

Returns

String.

Parameters

  • cAliasList
    Specifies a comma-separated list of open tables or cursors, by name or work area numbers in any combination, to include in the updategram. If you specify no value or an empty string for cAliasList, Visual FoxPro uses all open tables and cursors in the current datasession that contain buffered changes.

  • nFlags
    Additive. Specifies whether the returned file is formatted.

    nFlag Bit Output Description
    0 0000 UTF-8 Formatted XML (default)
    1 0001 Unformatted (continuous string) XML
    2 0010 Empty elements written 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

    Note   When Output Encoding is UTF-8 (the default), the XML Declaration will not contain an Encoding= attribute (no encoding attribute = UTF-8).

    When Output Encoding is set to default to the Code Page of the cursor or table, the encoding attribute will be written according to the following table.

    Note   Encoding flags are set by combining bits 4 & 5 (0010000).

    Encoding flag Bits 4 and 5 Description
    +0 00 Windows 1252. (default)
    +16 01 Output encoding attribute is set to the code page of the cursor.
    +32 10 Output encoding attribute is set to UTF-8 - no character translation
    +48 11 Output encoding attribute is set to UTF-8 - double-byte characters are translated to UTF-8.

Remarks

To use XMLUPDATEGRAM( ), you must SET MULTILOCKS ON and enable table buffering.

An XML updategram is a representation of the before and after conditions of the changed portion of a Visual FoxPro table or cursor. XMLUPDATEGRAM( ) returns a character string that contains the updategram itself. Through additional processes you can use an updategram to commit these changes to the data represented by the XML UpDateGram document.

You should specify the key field list by issuing CursorSetProp( ) with a KeyFieldList clause against existing cursors and tables before issuing XMLUpdateGram( ). If you specify no key fields, both before and after representations will contain all the fields in the table. If you specify one or more key fields, only those fields will appear in the <before> section. Use the CursorSetProp( ) function to avoid possible errors generated by XMLUpdateGram( ) on tables containing Memo or General fields.

See Also

CursorToXML( ) Function | XMLTOCURSOR( ) Function | CURSORSETPROP( ) Function | COMPROP( ) Function