XmlSchemaCollection::Item Property (String^)
.NET Framework (current version)
Gets the XmlSchema associated with the given namespace URI.
Assembly: System.Xml (in System.Xml.dll)
Parameters
- ns
-
Type:
System::String^
The namespace URI associated with the schema you want to return. This will typically be the targetNamespace of the schema.
Property Value
Type: System.Xml.Schema::XmlSchema^The XmlSchema associated with the namespace URI; null if there is no loaded schema associated with the given namespace or if the namespace is associated with an XDR schema.
Important |
|---|
The XmlSchemaCollection class is obsolete in the .NET Framework version 2.0 and has been replaced by the XmlSchemaSet class. |
The following example checks to see if a schema is in the collection. If it is, it displays the schema.
if ( xsc->Contains( "urn:bookstore-schema" ) ) { XmlSchema^ schema = xsc[ "urn:bookstore-schema" ]; StringWriter^ sw = gcnew StringWriter; XmlTextWriter^ xmlWriter = gcnew XmlTextWriter( sw ); xmlWriter->Formatting = Formatting::Indented; xmlWriter->Indentation = 2; schema->Write( xmlWriter ); Console::WriteLine( sw ); }
.NET Framework
Available since 1.1
Available since 1.1
Show:
