XmlSchemaSet.Schemas Metod

Definition

Returnerar en samling XSD-scheman (XML Schema Definition Language) i XmlSchemaSet.

Överlagringar

Name Description
Schemas()

Returnerar en samling med alla XSD-scheman (XML Schema Definition Language) i XmlSchemaSet.

Schemas(String)

Returnerar en samling av alla XSD-scheman (XML Schema Definition Language) i XmlSchemaSet det som tillhör det angivna namnområdet.

Schemas()

Källa:
XmlSchemaSet.cs
Källa:
XmlSchemaSet.cs
Källa:
XmlSchemaSet.cs
Källa:
XmlSchemaSet.cs
Källa:
XmlSchemaSet.cs

Returnerar en samling med alla XSD-scheman (XML Schema Definition Language) i XmlSchemaSet.

public:
 System::Collections::ICollection ^ Schemas();
public System.Collections.ICollection Schemas();
member this.Schemas : unit -> System.Collections.ICollection
Public Function Schemas () As ICollection

Returer

Ett ICollection objekt som innehåller alla scheman som har lagts till i XmlSchemaSet. Om inga scheman har lagts till i XmlSchemaSetreturneras ett tomt ICollection objekt.

Exempel

I följande exempel visas hur du itererar över alla scheman XmlSchemaSeti .

Dim schemaSet As XmlSchemaSet = New XmlSchemaSet
schemaSet.Add("http://www.contoso.com/books", "http://www.contoso.com/books.xsd")

Dim schema As XmlSchema

For Each schema In schemaSet.Schemas()

    schema.Write(Console.Out)

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

foreach (XmlSchema schema in schemaSet.Schemas())
{
    schema.Write(Console.Out);
}

Kommentarer

Den här metoden returnerar scheman som lades till indirekt till XmlSchemaSet eftersom de importerades.

Note

Metoden Schemas motsvarar metoden för GetEnumerator den föråldrade XmlSchemaCollection.

Gäller för

Schemas(String)

Källa:
XmlSchemaSet.cs
Källa:
XmlSchemaSet.cs
Källa:
XmlSchemaSet.cs
Källa:
XmlSchemaSet.cs
Källa:
XmlSchemaSet.cs

Returnerar en samling av alla XSD-scheman (XML Schema Definition Language) i XmlSchemaSet det som tillhör det angivna namnområdet.

public:
 System::Collections::ICollection ^ Schemas(System::String ^ targetNamespace);
public System.Collections.ICollection Schemas(string? targetNamespace);
public System.Collections.ICollection Schemas(string targetNamespace);
member this.Schemas : string -> System.Collections.ICollection
Public Function Schemas (targetNamespace As String) As ICollection

Parametrar

targetNamespace
String

Schemaegenskapen targetNamespace .

Returer

Ett ICollection objekt som innehåller alla scheman som har lagts till i XmlSchemaSet det som tillhör det angivna namnområdet. Om inga scheman har lagts till i XmlSchemaSetreturneras ett tomt ICollection objekt.

Exempel

I följande exempel visas hur du itererar över alla scheman i http://www.contoso.com/books namnområdet i XmlSchemaSet.

Dim schemaSet As XmlSchemaSet = New XmlSchemaSet
schemaSet.Add("http://www.contoso.com/books", "http://www.contoso.com/books.xsd")

Dim schema As XmlSchema

For Each schema In schemaSet.Schemas("http://www.contoso.com/books")

    schema.Write(Console.Out)

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

foreach (XmlSchema schema in schemaSet.Schemas("http://www.contoso.com/books"))
{
    schema.Write(Console.Out);
}

Kommentarer

Om parametern targetNamespace är null eller Emptyreturneras alla scheman utan namnområde.

Den här metoden returnerar scheman som lades till indirekt till XmlSchemaSet eftersom de importerades.

Note

Metoden Schemas motsvarar metoden för Item[] den föråldrade XmlSchemaCollection.

Gäller för