System::Xml::Schema::XmlSchemaSet::Add 方法

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

将给定的 XmlSchema 添加到 XmlSchemaSet

SharedPtr<XmlSchema> System::Xml::Schema::XmlSchemaSet::Add(const SharedPtr<XmlSchema> &schema)
参数类型描述
schemaconst SharedPtr<XmlSchema>&要添加到 XmlSchemaSetXmlSchema 对象。

ReturnValue

如果模式有效,则返回一个 XmlSchema 对象。如果模式无效且指定了 ValidationEventHandler,则返回 nullptr 并触发相应的验证事件。否则,将抛出 XmlSchemaException

另见

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

将给定的 XmlSchemaSet 中的所有 XML Schema 定义语言 (XSD) 模式添加到 XmlSchemaSet

void System::Xml::Schema::XmlSchemaSet::Add(const SharedPtr<XmlSchemaSet> &schemas)
参数类型描述
schemasconst SharedPtr<XmlSchemaSet>&XmlSchemaSet 对象。

另见

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

将包含在 XmlReader 中的 XML Schema 定义语言 (XSD) 架构添加到 XmlSchemaSet

SharedPtr<XmlSchema> System::Xml::Schema::XmlSchemaSet::Add(String targetNamespace, const SharedPtr<XmlReader> &schemaDocument)
参数类型描述
targetNamespaceString模式的 targetNamespace 值,或使用 nullptr 来采用模式中指定的 targetNamespace
schemaDocumentconst SharedPtr<XmlReader>&XmlReader 对象。

ReturnValue

如果模式有效,则返回一个 XmlSchema 对象。如果模式无效且指定了 ValidationEventHandler,则返回 nullptr 并触发相应的验证事件。否则,将抛出 XmlSchemaException

另见

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

将位于指定 URL 的 XML Schema 定义语言 (XSD) 架构添加到 XmlSchemaSet

SharedPtr<XmlSchema> System::Xml::Schema::XmlSchemaSet::Add(String targetNamespace, const String &schemaUri)
参数类型描述
targetNamespaceString模式的 targetNamespace 值,或使用 nullptr 来采用模式中指定的 targetNamespace
schemaUriconst String&指定要加载的模式的 URL。

ReturnValue

如果模式有效,则返回一个 XmlSchema 对象。如果模式无效且指定了 ValidationEventHandler,则返回 nullptr 并触发相应的验证事件。否则,将抛出 XmlSchemaException

另见