XML parsing

G

gk

i want to send a XML string to a pop-up window.

the pop up window would accept the xml string and parse it.

and it will display the parsed elements.

How should it be done ?


should i first parse the XML and put those in the javabean ?


Please tell me the flow , how this could be done ?
 
T

Thomas Weidenfeller

gk said:
i want to send a XML string to a pop-up window.

the pop up window would accept the xml string and parse it.

and it will display the parsed elements.

How should it be done ?


should i first parse the XML and put those in the javabean ?


Please tell me the flow , how this could be done ?

You provide very few information to work with. What seems apparent for
me is that you have not GUI centric application architecture in mind.
"send an XML string to a pop-up window" is usually not what one does in
a GUI application (whatever you understand as "send"). Also, a pop-up
window is not where one would typically parse XML. You sound as if you
try to apply a typical batch-job-like flow of control (pushing data
around) in a GUI application. This typically fails in GUI application.

GUI applications are typically event centered. The GUI is in control,
and you don't "send" something to a GUI, instead the GUI requests
information when it seems appropriate for the GUI.

Very popular GUI application architectures are MVC and its many
variants. In this architecture you have a separation of concerns (who is
doing what and when), and clear communication ways (events). And in
fact, Sun's GUI toolkit is based on an MVC variant. I would suggest you
spend some time to learn the principles of the Swing/AWT architecture
first (the comp.lang.java.gui FAQ should contain a pointer to a TSC
article describing the Swing architecture, plus pointers to Sun's GUI
tutorial).

You won't get very fare if you try to beat the existing architecture
into submission by throwing heaps of code onto it.

Once you know the Swing/AWT architecture you can design your
application. You will probably have some model (maybe a TreeModel),
which provides the information from the XML data in a way suitable for a
Swing Component (widget), maybe a JTree. The JTree might end up in some
JDialog, and the JDialog might provide some way to couple the model with
the widget used to display the data.

/Thomas
 
Joined
Oct 22, 2012
Messages
1
Reaction score
0
parse 35 GB XML files quickly...

Have you tired Expresso XML Parser? It's a high performance parser that has a graphical interface. You log onto a website and parse your XML file online so you can create parsing rules without writing code. Then you link up to your existing project using their client code. At the moment they have client code in java and javascript.

They have a free developer version at sxml. com. au
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top