ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Geometry Namespace / GeometryBagBuilderEx Class / FromXml Method
XML string representation of GeometryBag.
Example

In This Topic
    FromXml Method (GeometryBagBuilderEx)
    In This Topic
    Creates a new instance of a GeometryBag class from an XML string representation.
    Syntax
    Public Shared Function FromXml( _
       ByVal xmlString As String _
    ) As GeometryBag
    public static GeometryBag FromXml( 
       string xmlString
    )

    Parameters

    xmlString
    XML string representation of GeometryBag.

    Return Value

    Exceptions
    ExceptionDescription
    The xmlString is empty or null.
    XML is invalid or does not represent a GeometryBag string.
    Example
    Construct GeometryBag - from JSON, Xml
    {
      const string jsonString = "{\"geometries\":[{\"x\":1,\"y\":2},{\"rings\":[[[0,0],[0,4],[3,4],[3,0],[0,0]]]}],\"spatialReference\":{\"wkid\":4326,\"latestWkid\":4326}}";
      var geometryBag = GeometryBagBuilderEx.FromJson(jsonString);
    
      string xml = geometryBag.ToXml();
      var xmlString = GeometryBagBuilderEx.FromXml(xml);
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also