What are the advantages of creating web pages with XML instead of HTML?

后端 未结 6 977
你的背包
你的背包 2021-02-08 00:46

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 w

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-08 01:14

    When you are getting XML data in to your system, and you are supposed to present this XML data then it is much easier to write some XSLT for that XML instead of parsing it using some sort of parser and then presenting the data.

    That can be a valid point for using XML instead of XHTML or HTML

    Update To answer your question on why this is not widespread, is because XSTL is tedious and hard to work with. Specifically XPath, which can be for some people quite difficult to use.

提交回复
热议问题