HTML - xml数据岛 [英] HTML - xml data islands

查看:95
本文介绍了HTML - xml数据岛的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设计一个web应用程序,我打算在xml岛上嵌入数据,以便我可以根据用户选择的选项在客户端的HTML表格上动态呈现它。



我有广泛的概念,但我需要指导如何使用DOM来浏览我的xml。如何更新我的xml岛可能发回服务器?



请在线资源的任何链接或快速建议将非常赞赏。 b
$ b

注意:我理解大多数动态HTML概念和服务器端和客户端端的东西,所以不要害怕在响应中技术性很强:)

W3C HTML中没有XML数据岛(除非您指的是通过使用JavaScript加载的框架链接的外部XML文件),但您可以在 class title 中重新使用HTML元素并插入元数据(如果您关心HTML4有效性) code> data - * (HTML5)或您的自定义属性。


$ b 对于DOM导航,您有 DOM Core ,如元素.childNodes .nextSibling .getAttribute()等。



DOM可以详细而繁琐的使用(例如,当在DOM中查找元素时,必须小心跳过文本节点),所以在它之上构建了诸如jQuery和Prototype之类的JS库,可以提供更方便的API。



<如果您打算进行大量的DOM转换,那么您可以使用Javascript API(用于 XPath XSLT处理器将会很方便。


I am designing a web app and I intent to embed data on an xml island so that I can dynamically render it on an HTML table on the client-side based on options the users will select.

I have the broad concepts, but I need pointers on how to use DOM in navigating my xml. And how to update my xml island possibly for posting back to the server?

Please any links to online resources or a quick advice will be very appreciated.

NB: I understand most of the dynamic HTML concepts and server and client side stuff, so don't shy being very technical in your response:)

解决方案

In W3C HTML there are no XML data islands (unless you're referring to external XML file linked via frames loaded using Javascript), but you can re-use HTML elements and insert metadata in class, title (if you care about HTML4 validity), data-* (HTML5) or your custom attributes.

For DOM navigation you've got DOM Core, like element.childNodes, .nextSibling, .getAttribute(), etc.

DOM can be verbose and tedious to use (e.g. when looking for elements in DOM you have to be careful to skip text nodes), so there are JS libraries like jQuery and Prototype built on top of it that offer more convenient API.

If you intend to a lot of DOM transformations, then Javascript API for XPath and XSLT processor will be handy.

这篇关于HTML - xml数据岛的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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