JavaScript Editor js editor     Web development 

Main Page

Contains an object reference to the ISchemaItemCollection object after the successful execution of the XMLAdapterВ LoadXML or Attach method.

If the LoadXML and Attach methods analyze the XML schema, they set XMLConstraints to the appropriate value, although Visual FoxPro neither analyzes nor enforces any constraints declared in the XMLConstraints collection.


Return Value

Object reference. XMLConstraints contains an object reference to the ISchemaItemCollection object or a null value (.NULL.) when not populated.


Applies To: XMLAdapter Class | XMLTable Class

XML schema can contain constraints, which are associated with the schema. XMLConstraints provides you with access to constraints defined within the DataSet element.

Visual FoxPro does not include any functionality in XMLAdapter that uses these constraints, but it provides access so that you can obtain constraints information and use them in your application if needed.

In the following XML example, note the location of the Primary Key constraint:

В Copy Code
<?xml version="1.0" encoding="Windows-1252"?>
<DataSet xmlns="">
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true">
      <xs:choice maxOccurs="unbounded">
         <xs:element name="Tbl2">
                  <xs:element name="source"/>
                  <xs:element name="num" type="xs:int"/>
                  <xs:element name="xdtime" type="xs:dateTime"/>
                  <xs:element name="xlog" type="xs:boolean"/>
   <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//Tbl2"/>
      <xs:field xpath="source"/>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<NewDataSet xmlns="">
   <Tbl2 diffgr:id="Tbl21" msdata:rowOrder="0">
      <source>Buckner             </source>

See Also

JavaScript Editor js editor     Web development