• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XML to Table

 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
i would like to know how i can make use of XML data - gotten from a URL as a data stream- which i parsed using the SAX parser....

code looks something like this:



How do i make use of the data to say: put it into an SWT / Swing table...such that the content is sorted according to root elements and tags.

i need to:
1. filter out the tags,...put these as table headers
2. fill out the table with the extracted contents.

thanks in advance...

-W.O.
 
Ranch Hand
Posts: 529
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is quite a loaded question, isn't it...
So it looks like you want to use this XML as your model for a table. Both JFace ( not SWT ) and Swing have the notion of model-view-controller, so you can use this data as the model for your table control.

From how I see it you need to do 3 things initially:
1) Decide if you are using JFace/SWT or Swing.
2) Do a little research yourself into the classes you will be using: TableViewer for JFace, JTable ( I think ) for Swing.
3) Is this model going to be dynamic or do you already know in advance what the XML elements are. This will decide how and when you will create the table columns.

Hope this helps.
 
Wolfgang Obi
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Barry Andrews:
This is quite a loaded question, isn't it...
So it looks like you want to use this XML as your model for a table. Both JFace ( not SWT ) and Swing have the notion of model-view-controller, so you can use this data as the model for your table control.

From how I see it you need to do 3 things initially:
1) Decide if you are using JFace/SWT or Swing.
2) Do a little research yourself into the classes you will be using: TableViewer for JFace, JTable ( I think ) for Swing.
3) Is this model going to be dynamic or do you already know in advance what the XML elements are. This will decide how and when you will create the table columns.

Hope this helps.



thank you for your reply Barry....this has given me a little more direction.

I will be working with SWT,... so, what i will probably be needing is JFace (Tableviewer)!

The model will be static to start with, and later on -when i've finished testing- will be adjusted to become dynamic.

-W.O.
 
What? What, what, what? What what tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic