Share via


ForceCloseTag Property

Specifies whether to replace single empty element tags with a set of empty element open and close tags. You can use the ForceCloseTag if you search for open and close tags when parsing XML or if you want to increase readability.

ForceCloseTag applies when executing the XMLAdapterToXML method, which creates XML consistent with its setting.

XMLAdapter.ForceCloseTag [= lValue]

Property Values

  • lValue
    Logical data type. The following table lists the values for lValue.
    lValue Description
    False (.F.) Does not replace single empty element tags with a set of empty element open and close tags. (Default)
    True (.T.) Replaces single empty element tags with a set of empty element open and close tags.

Example

The following example contains an empty element tag, <col1/>:

<?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
<VFPData>
   <etest>
      <col1>One</col1>
   </etest>
   <etest>
      <col1/>
   </etest>
</VFPData>

Setting ForceCloseTag to True (.T.) replaces the single empty element tag with a set of valid empty element open and close tags, <col1></col1>.

<?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
<VFPData>
   <etest>
      <col1>One</col1>
   </etest>
   <etest>
      <col1></col1>
   </etest>
</VFPData>

See Also

Properties | XMLAdapter Object Properties, Methods, and Events

Applies To: XMLAdapter Class