Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要验证一个XML文件,XSD Schema并且代码工作正常。但目前,模式以字符串格式存储在数据库中,验证代码如下所示,不起作用
XML
XSD Schema
XmlReaderSettings settings = new XmlReaderSettings(); settings.Schemas.Add(null,"SchemaURL");
请帮助
试试这个:
StringReader stringReader = new StringReader("XmlSchema"); XmlSchema xmlSchema; xmlSchema = XmlSchema.Read(stringReader, null); settings.Schemas.Add(xmlSchema);