xmlSchemaSet = new XmlSchemaSet(); xmlSchemaSet.Add(null, XmlReader.Create(@"customer.xsd")); // Validate try { source.Validate(xmlSchemaSet, ValidationCallback, true); } catch (Exception ex) { xmlSchemaSet = new XmlSchemaSet(); xmlSchemaSet.Add(null, XmlReader.Create(@"customer.xsd")); // Validate xmlSchemaSet = new XmlSchemaSet(); xmlSchemaSet.Add(null, XmlReader.Create(@"customer.xsd")); // Validate try { source.Validate(xmlSchemaSet, ValidationCallback, true); } catch (Exception ex) {
XmlSchemaTraverseExample { static void Main() { // Add the customer schema to a new XmlSchemaSet XmlSchemaSet schemaSet = new XmlSchemaSet(); schemaSet.ValidationEventHandler += new ValidationEventHandler blcchargeupin.xsd"); schemaSet.Compile(); // Retrieve the compiled XmlSchema object from the XmlSchemaSet
xml格式是否正确 通过xsd验证 string error = ""; //声明XmlSchema XmlSchemaSet schemas = new XmlSchemaSet(); schemas.Add("", XmlReader.Create(AppDomain.CurrentDomain.BaseDirectory
8: 9: public ServiceDescriptionCollection GeneratedWsdlDocuments { get; } 10: public XmlSchemaSet
Schemas 获取或设置与此 XmlDocument 关联的 XmlSchemaSet 对象。 Value 获取或设置节点的值。 (继承自 XmlNode。)