text: XmlSchemaSet.Add Method (String, String)
  Assembly: System.Xml (in system.xml.dll)
  Parameters
  - targetNamespace
  The schema targetNamespace property, or a null reference (Nothing in Visual Basic) to use the targetNamespace specified in the schema.
  - schemaUri
  The URL that specifies the schema to load..
  Adding a schema to the XmlSchemaSet with the same target namespace and schema location URL as a schema already contained within the XmlSchemaSet will return the original schema object.
  When a new schema is successfully added to an XmlSchemaSet, the IsCompiled property of the XmlSchemaSet is set to false.
  Any include or import elements encountered in an XML schema are resolved when the Add method is called. Failure to resolve include and import elements results in a schema validation warning and if no ValidationEventHandler has been specified for the XmlSchemaSet object, these warning will not be reported.
  If a schema with the same target namespace as a schema that already exists in the XmlSchemaSet is added to the XmlSchemaSet, both schemas are added.
  The Add method of the XmlSchemaSet has the ability to use the target namespace defined in a schema, rather than requiring the target namespace be specified as a parameter when the Add method is called. Specifying a null reference (Nothing in Visual Basic) or Empty to the Add method instructs the XmlSchemaSet to use the target namespace defined in the schema, as illustrated in the following code example.
  In the code example above, a null reference (Nothing in Visual Basic) is specified as the targetNamespace parameter to the Add method. As a result, the targetNamespace defined in the books.xml file is used. In this case, the result of calling the Add method would be identical if had been specified as the targetNamespace parameter.
  W3C XML Schema allows schemas without a target namespace to be included in schemas with a target namespace defined. In this case, the schema without a target namespace defined is coerced into the target namespace of the including schema. The included schema is treated as if it had that target namespace defined. Similarly, schemas without a target namespace can be added to the XmlSchemaSet and coerced into the target namespace specified by the Add method, as illustrated in the following example.
  If the schema above is added to the XmlSchemaSet with the target namespace (as shown in the code below), it is treated as if the target namespace declared in the schema was.
  The following code example adds the schema with a target namespace of to the XmlSchemaSet.
  The example uses the books.xsd file as input.
  <?xml version="1.0" encoding="utf-8"?> <xs:schema </xs:sequence> <xs:attribute <xs:attribute <xs:attribute </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs.