Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   XML parsing (http://www.velocityreviews.com/forums/t149154-xml-parsing.html)

gk 01-09-2006 01:15 PM

XML parsing
 
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 ?


Thomas Weidenfeller 01-09-2006 01:48 PM

Re: XML parsing
 
gk wrote:
> 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
--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/...g/java/gui/faq
http://www.uni-giessen.de/faq/archiv....java.gui.faq/

goasklaura 10-22-2012 03:05 PM

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


All times are GMT. The time now is 10:25 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57