| 查看: 213 | 回复: 1 | |||
| 【奖励】 本帖被评价1次,作者arqiu增加金币 0.25 个 | |||
| 当前主题已经存档。 | |||
[资源]
XML Problem Design Solution (Programmer to Programmer)
|
|||
|
by Mitch Amiano Posted by :: Alexpal | Date :: Jan 22, 2007 01:00:00 ![]() XML Problem Design Solution (Programmer to Programmer) by Mitch Amiano, Conrad D'Cruz, Kay Ethier, Michael D. Thomas Publisher: Wrox (June 13, 2006) | ISBN-10: 0471791199 | PDF | 8,3 Mb | 333 pages — Offering a unique approach to learning XML, this book walks readers through the process of building a complete, functional, end-to-end XML solution — Featured case study is an online business product catalog that includes reports, data input/output, workflow, stylesheet formatting, RSS feeds, and integration with external services like Google, eBay, and Amazon — The format of presenting a problem and working through the design to come up with a solution enables readers to understand how XML markup allows a business to share data across applications internally or with partners or customers even though they might not use the same applications You'll learn various resolutions to common business and technology needs that are best solved using XML. Plus, you'll get under the hood of everyday applications and web services and discover how to tackle XML markup. By the end of the book, you will understand how to leverage XML applications in order to build a complete, functional, end-to-end XML solution. What you will learn from this book — How to share XML data with both internal and external users — Ways to style XML so that it can be used for browser presentation — Techniques for converting XML content online using XSLT, the XML transformation language — How to search, merge, and transform XML documents — Strategies for designing enterprise solutions using XML, workflow engines, and business process management systems — How to create PDF output and produce RSS feeds Download from Ftp2Share |
» 猜你喜欢
基金委咋了?2026年的指南还没有出来?
已经有4人回复
纳米粒子粒径的测量
已经有8人回复
疑惑?
已经有5人回复
国自然申请面上模板最新2026版出了吗?
已经有14人回复
计算机、0854电子信息(085401-058412)调剂
已经有5人回复
Materials Today Chemistry审稿周期
已经有5人回复
溴的反应液脱色
已经有7人回复
推荐一本书
已经有12人回复
基金申报
已经有4人回复
常年博士招收(双一流,工科)
已经有4人回复
★ 一星级,一般
★ ★
sinapdb(金币+2):thanks
sinapdb(金币+2):thanks
|
AJAX:拥抱JSON,让XML走开 转自www.jialing.net AJAX(Asynchronous JavaScript and XML)说到底就是一种浏览器异步读取服务器上XML内容的技术。现在的技术凡是跟XML扯上关系,再加上个概念做幌子,就像金装了一样,拽得不行。门外的人看得很是热闹,门里的人摇摇头不外如是。 XML呢,跨平台的新潮语言?其实XML=TXT。XML只是符合很多规范的文本。它本身什么都不是,只是保存字符的文件。而浏览器异步读取的只是服务器上的文本内容,所以在Ajax开发时完全不必拘泥于XML。 •JSON的来历 XML 的作用是格式化数据内容。如果我们不用XML还有什么更好的方法吗? 这个答案是JSON。 介绍JSON之我先介绍一下JavaScript这门脚本语言。脚本语言自身有动态执行的天赋。即我们可以把想要执行的语句放在字符串里,通过eval()这个动态执行函数来执行。字符串里的内容会像我们写的脚本 一样被执行。 示例1: 打开页面会弹出hello窗口。 我们可以在字符串中放任何脚本语句,包括声明语句: 如果在后台异步传来的文本是JavaScript的声明语句,那么不是一条eval方法就能解析了?对于解析复杂的XML,这样的效率是多么大的提高啊! 现在就来告诉你什么是JSON:JavaScript Object Notation。 我更愿意把它翻译为JavaScript对象声明。 比如要从后台载入一些通讯录的信息,如果写成XML,如下: 而写成JSON呢: [ { name:"Michael", email:"17bity@gmail.com", homepage:"http://www.jialing.net" }, { name:"John", email:"john@gmail.com", homepage:"http://www.jobn.com" }, { name:"Peggy", email:"peggy@gmail.com", homepage:"http://www.peggy.com" } ] 简单不只是表达上,最重要的是可以丢弃让人晕头转向的DOM解析了。 因为只要符合JavaScript的声明规范,JavaScrip会自动帮你解析好的。 Ajax中使用JSON的基本方法是前台载入后台声明JavaScript对象的字符串,用eval方法来将它转为实际的对象,最后通过 DHTML更新页面信息。 •JSON的格式 JSON的基本格式如下,图片来自json.org: ![]() 对象是属性、值对的集合。一个对象的开始于"{",结束于"}"。每一个属性名和值间用":"提示,属性间用","分隔。 数组是有顺序的值的集合。一个数组开始于"[",结束于"]",值之间用","分隔。 ![]() 值可以是引号里的字符串、数字、true、false、null,也可以是对象或数组。这些结构都能嵌套。 ![]() 字符串的定义和C或Java基本一致。 ![]() 数字的定义也和C或Java基本一致。 ![]() •JSON VS XML 可读性 JSON和XML的可读性可谓不相上下,一边是建议的语法,一边是规范的标签形式,很难分出胜负。 可扩展性 XML天生有很好的扩展性,JSON当然也有,没有什么是XML能扩展,JSON不能的。 编码难度 XML有丰富的编码工具,比如Dom4j、JDom等,JSON也有json.org提供的工具,但是JSON的编码明显比XML容易许多,即使不借助工具也能写出JSON的代码,可是要写好XML就不太容易了。 解码难度 XML的解析得考虑子节点父节点,让人头昏眼花,而JSON的解析难度几乎为0。这一点XML输的真是没话说。 流行度 XML已经被业界广泛的使用,而JSON才刚刚开始,但是在Ajax这个特定的领域,未来的发展一定是XML让位于JSON。到时Ajax应该变成Ajaj(Asynchronous JavaScript and JSON)了。 附: JSON.org : http://www.json.org/ JSON in JavaScript : http://www.json.org/js.html JSON: The Fat-Free Alternative to XML : http://www.json.org/xml.html JSON and the Dynamic Script Tag: Easy, XML-less Web Services for JavaScript: http://www.xml.com/pub/a/2005/12/21/json-dynamic-script-tag.html Using JSON (JavaScript Object Notation) with Yahoo! Web Services: http://developer.yahoo.com/common/json.html |
2楼2007-01-22 11:19:27












回复此楼



