XmlSchemaCollection::GetEnumerator Method ()
.NET Framework (current version)
Provides support for the "for each" style iteration over the collection of schemas.
Assembly: System.Xml (in System.Xml.dll)
Return Value
Type: System.Xml.Schema::XmlSchemaCollectionEnumerator^An enumerator for iterating over all schemas in the current collection.
Important |
|---|
The XmlSchemaCollection class is obsolete in the .NET Framework version 2.0 and has been replaced by the XmlSchemaSet class. |
The following example displays each of the XML Schemas in the schema collection.
public: void DisplaySchemas( XmlSchemaCollection^ xsc ) { XmlSchemaCollectionEnumerator^ ienum = xsc->GetEnumerator(); while ( ienum->MoveNext() ) { XmlSchema^ schema = ienum->Current; StringWriter^ sw = gcnew StringWriter; XmlTextWriter^ writer = gcnew XmlTextWriter( sw ); writer->Formatting = Formatting::Indented; writer->Indentation = 2; schema->Write( writer ); Console::WriteLine( sw ); } }
.NET Framework
Available since 1.1
Available since 1.1
Show:
