Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / January 2005

Tip: Looking for answers? Try searching our database.

java xml parser

Thread view: 
Martino - 25 Jan 2005 09:42 GMT
Hi, I'm new with Java graphic. I have an xml file with the informations
about the slots (attribute) of each module of my sistem, like

     <module name="NomeComponente" type="action">

         <phase>1</phase>

         <level>2</level>

         <basic>

             <caption>front-office telefonico</caption>

             <description>modulo per la gestione degli appuntamenti di
primo                   livello: possibilit? di confermarli, modificarli o
rifiutarli. In  caso                       di rifiuto l'operatore pu?
registrarne il motivo</description>

         </basic>

         <auto-execute>false</auto-execute>

         <sequencing>

             <previous_step>nomeComponentePrecedente</previous_step>

             <next_step>nomeComponenteSuccessivo</next_step>

         </sequencing>

         <permissions>

            <read>id_operatore1;id_operatore2;...;id_operatoreN</read>

            <execute>id_operatore1;id_operatore2;...;id_operatoreN</execute>

         </permissions>

<         </module>

            I have to buil a GUI from these informations with a panel that
shows them (for each attribute a lable and a text field I think, so the user
can read the attribute and modify it). I think I need an xml parser to store
the attributes of each module an present them. is there a ready parser
written in Java I can modify for my aim? Can someone help me?

           Thanks in advance

       Martino
bob.nipp@ngc.com - 26 Jan 2005 18:04 GMT
Here's what I would do.  Read in the XML using SAXParser, and your own
"handler".  Something like:

MyHandler handler = hew MyHandler();
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser parser = factory.newSAXParser();
parser.parse(<File>, handler);
...

class MyHandler extends DefaultHandler {
<see the JavaDoc for DefaultHandler to know how to parse
XML elements as they are read from file.>
<use this handler to fill in objects that contain the data
you will eventually use to populate your GUI>
}

------------------
Your GUI would call the above parsing routines to parse the XML file,
and then use the data acquired in "MyHandler" to build whatever
components
it needs.

Hope that helps.

...bob

> Hi, I'm new with Java graphic. I have an xml file with the informations
> about the slots (attribute) of each module of my sistem, like
[quoted text clipped - 11 lines]
>               <description>modulo per la gestione degli appuntamenti di
> primo                   livello: possibilità di confermarli,
modificarli o
> rifiutarli. In  caso                       di rifiuto l'operatore
può
> registrarne il motivo</description>
>
[quoted text clipped - 11 lines]
>
>           <permissions>

<read>id_operatore1;id_operatore2;...;id_operatoreN</read>

<execute>id_operatore1;id_operatore2;...;id_operatoreN</execute>

>           </permissions>
>
[quoted text clipped - 9 lines]
>
>         Martino


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.