C#中引用的XSD验证XML
xsi:schemaLocation="someurl ..\localSchemaPath.xsd"
XmlDocument asset = new XmlDocument();XmlTextReader schemaReader = new XmlTextReader("relativeSchemaPath"); XmlSchema schema = XmlSchema.Read(schemaReader, SchemaValidationHandler);asset.Schemas.Add(schema);asset.Load(filename); asset.Validate(DocumentValidationHandler);
相关分类