Partilhar via


AddTableSchema Method

Adds a new XMLTable object to the XMLAdapter Tables collection and the necessary XMLField objects to the XMLTable Fields collection based on the specified table alias.

The following parameters must be converted to Unicode before passing as parameters to AddTableSchema:

  • cXMLName

  • cXMLNamespace

  • cXMLPrefix

You can use theSTRCONV( ) function to perform this requirement.

XMLAdapter.AddTableSchema(cAlias [, lElementBased [, cXMLName 
   [, cXMLNamespace [, cXMLPrefix [, lWrapMemoInCDATA 
   [, lWrapCharacterInCDATA[, lAutoNest]]]]]]])

Parameters

  • cAlias
    Specifies the alias of the Visual FoxPro table or cursor to use as a schema template.
  • lElementBased
    Specifies the style of XML. The default value of lElementBased is True (.T.).
  • cXMLName
    Specifies the name to use for the table in the XML and must be converted to Unicode before passing as a parameter. The default value for the cXMLName parameter is the value of the cAlias parameter. Conversion to Unicode is performed automatically.
  • cXMLNamespace
    Specifies the XML Namespace to use, which must be converted to Unicode before passing as a parameter. The default value is an empty ("") string.
  • cXMLPrefix
    Specifies the XML Prefix to use, which must be converted to Unicode before passing as a parameter. The default value is an empty ("") string.
  • lWrapMemoInCDATA
    Specifies whether to wrap Memo fields in CDATA sections. The default value is specified by the WrapMemoInCDATA property for the XMLAdapter object.
  • lWrapCharacterInCDATA
    Specifies whether to wrap Character fields in CDATA sections. The default value is specified by the WrapCharInCDATA property for the XMLAdapter object.
  • lAutoNest
    Specifies whether tables added to the XMLAdapter Tables collection are automatically nested. The default value is specified by the RespectNesting property for the XMLAdapter object.

Remarks

Applies To: XMLAdapter Class

The following property settings affect how the AddTableSchema method is executed:

If lAutoNest is set to True (.T.), nesting of the XMLTable objects in the XMLAdapter Tables collection occurs after the new XMLTable object is added. The relationship specified with the SET RELATION Command and the XMLTable Alias property determine the nesting schema.

  • Parent Tables: The first XMLTable object with an Alias property value matching the Alias of a parent cursor in any relationship to the new table becomes the parent XMLTable object for the new XMLTable object, and the new XMLTable object becomes the last nested object.

  • Nested Tables: Any XMLTable objects with an alias matching the alias of a child cursor in any relationship from the new table becomes a nested XMLTable object in the new XMLTable object, unless it is already nested.

See Also

Reference

XMLAdapter Object Properties, Methods, and Events
Tables Collection (XMLAdapter)
XMLField Class
Fields Collection (XMLTable)
STRCONV( ) Function
RespectNesting Property
Memo Field Type
Character Data Type

Other Resources

Methods (Visual FoxPro)