XML Parser for GWT

38 kali dilihat
Langsung ke pesan pertama yang belum dibaca

Kernel_panik

belum dibaca,
24 Agu 2007, 16.05.2424/08/07
kepadaGoogle Web Toolkit
Hi,

how can i parse xml with GWT ?

thank you.

Kernel_panik

belum dibaca,
24 Agu 2007, 16.09.4824/08/07
kepadaGoogle Web Toolkit
i've ever used this : http://gwt.components.googlepages.com/simplexmlparser
but there is errors when compiling :

[ERROR] Unable to load module entry point class
com.filesys.client.FileSys (see associated exception for details)
java.lang.Error: Unresolved compilation problem:

at com.filesys.client.FileSys.essai(FileSys.java:38)
at com.filesys.client.FileSys.onModuleLoad(FileSys.java:35)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:342)
at
com.google.gwt.dev.shell.BrowserWidget.attachModuleSpace(BrowserWidget.java:
326)
at com.google.gwt.dev.shell.ie.BrowserWidgetIE6.access
$200(BrowserWidgetIE6.java:36)
at
com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.gwtOnLoad(BrowserWidgetIE6.java:
70)
at
com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.invoke(BrowserWidgetIE6.java:
125)
at
com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:
293)
at
com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:
196)
at
org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:
117)

Have you a solution ?

thank you

Sumit Chandel

belum dibaca,
24 Agu 2007, 16.10.5124/08/07
kepadaGoogle-We...@googlegroups.com
Hi Kernel,

You'll find the XMLParser class in the com.google.gwt.xml.client package useful:

http://code.google.com/webtoolkit/documentation/com.google.gwt.xml.client.html

Thanks,
-Sumit Chandel

Thad Humphries

belum dibaca,
24 Agu 2007, 17.50.3024/08/07
kepadaGoogle-We...@googlegroups.com
GWT includes a DOM package com.google.gwt.xml.client. You'll have to add
<inherits name='com.google.gwt.xml.XML'/> to your project's MyProject.gwt.xml
file in order to use it.

I will warn you that processing all but the simplest XML file with this
package is horribly painful. There is no XPATH support so (1) you'd better
not have any long paths; (2) the structures must be very regular or you'll
get endlessly lost in checking for null nodes.

Many here have argued that you should do your heavy XML parsing on the server
side using tools like JDOM or Xalan. That idea has some merit but IMHO
sometimes the client is the best place for it.

I'm using some files I found referenced in this thread:

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/3fd5096791f5f859/51f0c3d47a95a163

These were JNSI wrappers around browser XPATH calls and can be made to work
well enough in IE, Firefox, and Camino. It's also very fast (the X. The
Sarissa project (http://dev.abiss.gr/sarissa/) has some good stuff, too,
along with links that claim to let this work in Safari 3 (I'm working on
that).

IMHO, it's far easier to pass the XML as a String to the client, parse it, and
then be able to reach into an XML structure via XPATH and get want you want
vs. parsing the XML on the server side, creating (in my case) a score of
classes to pass the data across the RPC layer, and then managing those
classes in my client. And as I said, it runs fast. So far I'm very pleased
with the XPATH and XSLT performance.

Balas ke semua
Balas ke penulis
Teruskan
0 pesan baru