如何将XSD转换为HTML [英] How to Convert XSD to HTML

查看:93
本文介绍了如何将XSD转换为HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述






我有一个.XSD文件,我想将其转换为HTML文件并将该文件保存到某些地方以供进一步使用。谁能告诉我如何做到这一点。我是VC ++ / MFC的新手,如果可能的话,用代码解释一下。



感谢Adavnce

Hi

I have a .XSD file, i want to convert it in to HTML file and save that file some where for further use. can any body tell me how to do this. I am new to VC++/MFC if possible with code explain me.

Thanks in Adavnce

推荐答案

xml架构的元素基于对象模型形成节点树。



对于.Net平台,此对象模型在System.Xml.Schema命名空间 [ ^ ]。



您需要将各种对象转换为适合对象类型的html表示形式 - 因为它们很多,所以它绝对不是一项简单的练习。



问候

Espen Harlinn
The elements of an xml schema forms a tree of nodes, based on an object model.

For the .Net platform this object model is realised in the System.Xml.Schema Namespace[^].

You will need to transform the various objects into an html representation suitable for the object type - and as there is a lot of them, it's definitely not a trivial exercise.

Regards
Espen Harlinn


并非不可能;它没有某种意义。换句话说,你的问题没有定义任何意义上的这种转换(这是一个不正确的术语!)应该完成。



XSD(XML模式定义)是一种描述元数据模式的方法。例如,它可以用于描述HTML标准(严格来说,只有XHTML)。 HTML表示应以符合(X)HTML标准的方式编写的数据。换句话说,一个单独的XSD应该描述一大堆不同的XML(理论上,无限但可数集)。我们遇到了概念上的不匹配。



但是,任何元数据都是一种数据,XSD不是排除的,它本身是用XML编写的,任何XML都可以呈现为某种标记,这可以作为HTML实现,并以人们可以读取和理解XSD作为模式的方式呈现。警告:这只是一个天真的转换的例子,这不是唯一可以用于任何特定目的的解决方案(除了以人类可读的方式显示XSD);我不知道真正的目的;你的问题表明你自己并不清楚。



用HTML字符替换所有'<','>'和'&'字符实体& lt;,& gt;和& amp;分别将XSD文件的内容夹在< pre>< / pre>中标签。就是这样。



-SA
Not that it is impossible; it makes no certain sense. In other words, you Question does not define any sense in which such "conversion" (what an improper term!) should be done.

XSD (XML Schema Definition) is a way to describe the meta-data schema. For example, it can be used to describe HTML standard (strictly speaking, only XHTML). HTML represent data which should be written in a way compliant with (X)HTML standard. In other words, one single XSD is supposed to describe a whole big set of different XMLs (theoretically, infinite but countable set). We came to conceptual mismatch.

However, any meta-data is a sort of data, and XSD is not an exclusion, it is itself is written in XML, and any XML can be rendered as some mark-up, which is possible to be implemented as HTML and rendered the way one can read and understand XSD as a schema. Warning: this is just an example of naive "conversion" which is no way the only solution serving any particular purpose (except showing the XSD in a human-readable way); the "real" purpose is unknown to me; and your Question suggests that you don't clearly understand it yourself.

Replace all '<', '>' and '&' characters by HTML character entities &lt;, &gt; and &amp;, respectively and sandwich the contents of the XSD file in <pre></pre> tags. That's it.

—SA


这篇关于如何将XSD转换为HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆