使用XML而不是HTML创建网页的优点是什么? [英] What are the advantages of creating web pages with XML instead of HTML?

查看:110
本文介绍了使用XML而不是HTML创建网页的优点是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时,我会看到其内容完全用XML编写的网页(不是HTML或XHTML)。这些页面通常会附带一些样式表(XSLT或CSS),使它们看起来像其他普通网页一样。



我的问题是,这种方法的优点是什么(如果有的话),为什么有人会选择这种方式?

编辑:如果这是一件好事,为什么它不被广泛传播? 编辑2: 感谢大家的好评。他们真的启发了我。我还发现了这个问题,他的内容也是相关的。

解决方案

更容易以编程方式生成它,并将其用于其他目的而不是显示为网页。 >




更新

$ b $编辑:如果这是一件好事,为什么它不是普遍?


不是每个人都需要以编程方式生成它,或者将其用于其他目的而不是显示为网页。使用纯HTML更容易。


From time to time, I see web pages whose content is solely written in XML (not HTML or XHTML). These pages usually have some style sheets (either XSLT or CSS) attached to them which makes them look like any other ordinary web page.

My question is, what are the advantages of such an approach (if any), and why would anyone choose to work this way?

EDIT: If this is a good thing, why is it not widespread?

EDIT 2: Thanks everyone for the great responses. They really enlightened me. I also found this question whose content is also related.

解决方案

It's easier to generate it programmatically and reuse it for other purposes than displaying as webpage.


Update:

EDIT: If this is a good thing, why is it not widespread?

Not everyone needs to generate it programmatically or reuse it for other purposes than displaying as webpage. It's then easier to use plain HTML.

这篇关于使用XML而不是HTML创建网页的优点是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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