<div style="font-family: Arial; font-size: 14px;">Hello,</div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">I am having trouble when creating a feature class with <b>subtypes and/or coded domains </b>with the FileGDB or OpenFileGDB drivers, specifically when using the "XML_DEFINITION" or "DOCUMENTATION" layer creation option.  I am simply creating a dataset and calling on CreateLayer:</div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">lyr = ds.CreateLayer("TESTPOINT_2", geom_type=ogr.wkbPoint, options=["XML_DEFINITION/DOCUMENTATION=%s" % <b>xmlstr</b>])</div><div style="font-family: Arial; font-size: 14px;"><span><span><b>ERROR 1: Failed at creating table for \TESTPOINT_2 (General function failure.)</b></span><br></span></div><div style="font-family: Arial; font-size: 14px;"><span><br></span></div><div style="font-family: Arial; font-size: 14px;"><b>xmlstr</b> is read from a file containing the XML.  The XML is based on FC_PCS_Point.xml found in the ESRI FileGDB API resources (in the XMLsamples folder) with added domain information. </div><div style="font-family: Arial; font-size: 14px;"> </div><div style="font-family: Arial; font-size: 14px;">My question is <b>where and how to to structure the domain and subtype XML tag/information when using an XML string as part of the XML_DEFINITION or DOCUMENTATION layer creation options?  </b>The GDAL documentation specifically mentions that for the xml string that the "<span> root node of such a XML definition must be a <esri:DataElement>".  Where are the <Domain> and <Subtype> elements to be placed?  Is the subtype and domain information only referenced in the Field elements?  I can not seem to get any type of XML string to work beyond a simple feature class or table and have not been able to add subtypes or domains.  I have attached the XML document that I am using to this email.  Please see the <Subtypes> element under the root <esri:DataElement> as well as the <Domain> under the ELEVATION Field element.  Any help or guidance would be greatly appreciated.</span></div><div style="font-family: Arial; font-size: 14px;"><span><br></span></div><div style="font-family: Arial; font-size: 14px;"><span>Kind regards,<br>Adam Gutonski</span></div><div style="font-family: Arial; font-size: 14px;"><br></div>
<div class="protonmail_signature_block" style="font-family: Arial; font-size: 14px;">
    <div class="protonmail_signature_block-user protonmail_signature_block-empty">
        
            </div>
    
            <div class="protonmail_signature_block-proton">
        Sent with <a target="_blank" href="https://proton.me/" rel="noopener noreferrer">Proton Mail</a> secure email.
    </div>
</div>