XmlSchemaCollectionEnumerator.Current Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the current XmlSchema in the collection.

Namespace:   System.Xml.Schema
Assembly:  System.Xml (in System.Xml.dll)

public XmlSchema Current { get; }

Property Value

Type: System.Xml.Schema.XmlSchema

The current XmlSchema in the collection.

The following example displays each of the XML Schema definition language (XSD) schemas in the schema collection.

public void DisplaySchemas(XmlSchemaCollection xsc)
  XmlSchemaCollectionEnumerator ienum = xsc.GetEnumerator();
  while (ienum.MoveNext())
    XmlSchema schema = ienum.Current;
    StringWriter sw = new StringWriter();
    XmlTextWriter writer = new XmlTextWriter(sw);
    writer.Formatting = Formatting.Indented;
    writer.Indentation = 2;


.NET Framework
Available since 1.1
Return to top