开发者

Using XML as a Content Management system (embed into HTML Docs)

开发者 https://www.devze.com 2023-03-05 09:29 出处:网络
I\'ve read a few questions on using XML and people are saying not to use it to pull in information and data to a HTML document.

I've read a few questions on using XML and people are saying not to use it to pull in information and data to a HTML document. I'd like to know why, I don't have access to mySQL and neither do a lot of my clients so I want to give them a simple way of updat开发者_开发技巧ing small sections of their site. Is XML and Javascript calls appropriate for this?

For example, updating a div that contains information on the latest deal in a shop.

Any answers would be great, I'm struggling to see the problem with using XML for things like this?

Thanks for your time!


XML is usable for the task of pulling in data for an HTML document. However, JSON has become a popular alternative for data interchange.

JSON (JavaScript Object Notation) is less verbose and quicker to parse that XML. It has a syntax familiar for those using C-like programming languages. It is also easy to generate on the server.

XML is more conveniently generated using XSLT on the server. Whether to favor XML or JSON as interchange format thus also depends on the server architecture. It is easy to convert data between the two though.

XML might be preferable over JSON for manual content authoring/editing by markup savvy users. XML is more self-descriptive and can be validated based on a DTD or Schema. However, most users would likely favor using some form for markdown instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号