Add()

XmlSchemaSet::Add(String, const String&) method

Adds the XML Schema definition language (XSD) schema at the URL specified to the XmlSchemaSet.

SharedPtr<XmlSchema> System::Xml::Schema::XmlSchemaSet::Add(String targetNamespace, const String &schemaUri)

Arguments

ParameterTypeDescription
targetNamespaceStringThe schema targetNamespace value, or nullptr to use the targetNamespace specified in the schema.
schemaUriconst String&The URL that specifies the schema to load.

Return Value

An XmlSchema object if the schema is valid. If the schema is not valid and a ValidationEventHandler is specified, then nullptr is returned and the appropriate validation event is raised. Otherwise, an XmlSchemaException is thrown.

Exceptions

ExceptionDescription
XmlSchemaExceptionThe schema is not valid.
ArgumentNullExceptionThe URL passed as a parameter is nullptr or String::Empty.

XmlSchemaSet::Add(String, const SharedPtr<XmlReader>&) method

Adds the XML Schema definition language (XSD) schema contained in the XmlReader to the XmlSchemaSet.

SharedPtr<XmlSchema> System::Xml::Schema::XmlSchemaSet::Add(String targetNamespace, const SharedPtr<XmlReader> &schemaDocument)

Arguments

ParameterTypeDescription
targetNamespaceStringThe schema targetNamespace value, or nullptr to use the targetNamespace specified in the schema.
schemaDocumentconst SharedPtr<XmlReader>&The XmlReader object.

Return Value

An XmlSchema object if the schema is valid. If the schema is not valid and a ValidationEventHandler is specified, then nullptr is returned and the appropriate validation event is raised. Otherwise, an XmlSchemaException is thrown.

Exceptions

ExceptionDescription
XmlSchemaExceptionThe schema is not valid.
ArgumentNullExceptionThe XmlReader object passed as a parameter is nullptr.

XmlSchemaSet::Add(const SharedPtr<XmlSchemaSet>&) method

Adds all the XML Schema definition language (XSD) schemas in the given XmlSchemaSet to the XmlSchemaSet.

void System::Xml::Schema::XmlSchemaSet::Add(const SharedPtr<XmlSchemaSet> &schemas)

Arguments

ParameterTypeDescription
schemasconst SharedPtr<XmlSchemaSet>&The XmlSchemaSet object.

Exceptions

ExceptionDescription
XmlSchemaExceptionA schema in the XmlSchemaSet is not valid.
ArgumentNullExceptionThe XmlSchemaSet object passed as a parameter is nullptr.

XmlSchemaSet::Add(const SharedPtr<XmlSchema>&) method

Adds the given XmlSchema to the XmlSchemaSet.

SharedPtr<XmlSchema> System::Xml::Schema::XmlSchemaSet::Add(const SharedPtr<XmlSchema> &schema)

Arguments

ParameterTypeDescription
schemaconst SharedPtr<XmlSchema>&The XmlSchema object to add to the XmlSchemaSet.

Return Value

An XmlSchema object if the schema is valid. If the schema is not valid and a ValidationEventHandler is specified, then nullptr is returned and the appropriate validation event is raised. Otherwise, an XmlSchemaException is thrown.

Exceptions

ExceptionDescription
XmlSchemaExceptionThe schema is not valid.
ArgumentNullExceptionThe XmlSchema object passed as a parameter is nullptr.

See Also