简体   繁体   English

GWT是否有任何基于SAX的解析器

[英]Is there any SAX based parser for GWT

I have tried to find any SAX based parser for GWT but could not find any. 我试图为GWT查找任何基于SAX的解析器,但找不到任何解析器。 Does anyone know if there is any such parser exists. 有谁知道是否存在这样的解析器。 The reason for asking is that my server return huge xml file and I literally hang the browser while parsing using Piriti parser. 问的原因是我的服务器返回了巨大的xml文件,并且在使用Piriti解析器进行解析时,我实际上挂起了浏览器。 Which I think is based on DOM. 我认为这是基于DOM的。

https://code.google.com/p/piriti/wiki/Xml https://code.google.com/p/piriti/wiki/Xml

No, for the reasons given here http://tinyurl.com/lxr5lw2 there's none, it'd make little sense. 不,出于此处http://tinyurl.com/lxr5lw2给出的原因,没有任何原因,这毫无意义。

  • do all the processing on the server and only send the relevant XML to the client 在服务器上进行所有处理,仅将相关XML发送给客户端
  • send JSON instead of XML because that's what JavaScript understands "natively" 发送JSON而不是XML,因为这是JavaScript可以“原生”理解的

I believe I'm not the only one telling you that ;-) 我相信我不是唯一一个告诉你的人 ;-)

If your concern is performance, I would give a try to gwtquery . 如果您担心性能,我会尝试gwtquery It is able to handle a XML string and convert it into a native browser xml object, so as you can use CSS selectors (and xpath in certain browsers) for traversing the document and reading/modifying almost everything. 它能够处理XML字符串并将其转换为本地浏览器xml对象,因此您可以使用CSS选择器(某些浏览器中的xpath)遍历文档并读取/修改几乎所有内容。

gQuery databinding can transform xml documents into POJOs, it does not handle all XML capabilities but almost of them. gQuery 数据绑定可以将xml文档转换为POJO,它不能处理所有XML功能,但几乎可以处理所有XML功能。

Parsing, transversing, reading and writing is done using native browser calls, so you shouldn't have big performance issues with large documents, but of course you could have if the document is huge (in this case consider splitting it in server side). 解析,遍历,读取和写入是使用本机浏览器调用完成的,因此大型文档不会出现较大的性能问题,但是如果文档很大,则当然可以(在这种情况下,请考虑在服务器端拆分)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM