Figaro - The XML Database for the .NET Framework

Examining Container Indices

You can iterate over all the indices in a container using Next. All indices retrieved come back in an XmlIndex object containing the node namespace, node name, and indexing strategy.
CopyC#
using System;
using Figaro.BerkeleyDB.Xml;
namespace Figaro.Documentation.Examples
{
    class IndexIteration
    {
        static void Main()
        {
            using (var mgr = new XmlManager(ManagerInitOptions.AllowExternalAccess | ManagerInitOptions.AllowAutoOpen))
            {
                prepareContainer(true);
                using (var container = mgr.OpenContainer(baseUri + testdb))
                {
                    try
                    {
                        XmlIndexSpecification spec = container.GetIndexSpecification();
                        XmlIndex xi = spec.Next();
                        while (null != xi)
                        {
                            Console.WriteLine("index found: '{0}', '{1}', '{2}'", xi.Index,xi.NodeName,xi.Namespace);
                            xi = spec.Next();
                        }
                    }
                    finally
                    {
                        container.Close();
                    }
                }
            }
        }