XmlSchemaCollection.Add Method (String, XmlReader)
Adds the schema contained in the XmlReader to the schema collection.
Assembly: System.Xml (in System.Xml.dll)
The namespace URI associated with the schema. For XML Schemas, this will typically be the targetNamespace.
If ns has already been associated with another schema in the collection, the schema being added replaces the original schema in the collection.
If ns is null and the schema being added is an XML Schema, the Add method uses the targetNamespace defined in the XML Schema to identify the schema in the collection.
If the schema being added contains references to other namespaces (through include and import elements or the x-schema attribute), the trust level of the application determines how these other namespaces are resolved. (In the .NET Framework version 1.0, a default XmlUrlResolver was always used).
Fully trusted code: A default XmlUrlResolver with no user credentials is used to resolve any external resources. The schemas for these other namespaces are loaded for validation purposes only. Unlike the original schema, these other schemas are not explicitly added to the schema collection. As a result, they are not accessible using any of the collection methods or properties. If these external resources are located on a network resource that requires authentication, use an overload that takes an XmlResolver as one of its arguments and specify an XmlResolver with the necessary credentials.
Semi-trusted code: External references are not resolved.
Available since 1.1