从XSD生成XML [英] Generate XML FROM XSD
本文介绍了从XSD生成XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须使用国家机构的多个XSD文件.它们可能会经常更改.
I have to use multiple XSD files from a state agency. They could change quite often. Is there a way to use the xsd files to generate xml files at runtime in vb.net?
推荐答案
看看此MSDN文章:
从XML模式生成XML文档 [
Look at this MSDN article:
Generating XML Documents from XML Schemas[^]
我相信XSD文件仅此而已而不是缺少标题行的XML文件.如果创建一个StringBuilder
对象,则以xml文件头开始,将xsd文件作为文本读入并将该文本附加到StringBuilder
对象,然后可以只调用XDocuiment.Parse(stringBuilder.ToString())
和Bob的你叔叔.
I believe that a XSD file is nothing more than an XML file missing the header line. If you create aStringBuilder
object, start it out with the xml file header, read the xsd file in as text and append the text to theStringBuilder
object, you can then just callXDocuiment.Parse(stringBuilder.ToString())
, and Bob''s your uncle.
这篇关于从XSD生成XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文