XmlSchemaSet.CopyTo Method (XmlSchema[], Int32)


Copies all the XmlSchema objects from the XmlSchemaSet to the given array, starting at the given index.

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

public void CopyTo(
	XmlSchema[] schemas,
	int index


Type: System.Xml.Schema.XmlSchema[]

The array to copy the objects to.

Type: System.Int32

The index in the array where copying will begin.

The following example copies all the XmlSchema objects in the XmlSchemaSet to an array of XmlSchema objects.

XmlSchemaSet schemaSet = new XmlSchemaSet();
schemaSet.Add("http://www.contoso.com/retail", "http://www.contoso.com/retail.xsd");
schemaSet.Add("http://www.contoso.com/books", "http://www.contoso.com/books.xsd");
schemaSet.Add("http://www.contoso.com/music", "http://www.contoso.com/music.xsd");

XmlSchema[] schemas = new XmlSchema[schemaSet.Count];
schemaSet.CopyTo(schemas, 0);

.NET Framework
Available since 2.0
Return to top