DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: XML and JAVA

  1. #1
    Join Date
    Jul 2005

    XML and JAVA

    I have two xml files. One contains all the information about courses of a department and the other contains class time, exam time, labs etc of each courses.

    The first file remains fixed i.e it's never changed (A department rarely changes it's courses). But the other one changes every semester (not all the courses of the first file are offered every semester). The common thing about both files is that both have course id.

    Now I need a way to display information about the offered courses (from the second file) taking some of the information from the first file.

    Take a look at this :

    FILE ONE :

    <id>CE 201</id>
    <name>Electrical Engineering</name>

    <id>CE 202</id>

    <id>CE 301</id>
    <name>Numerical Analysis</name>


    FILE 2 :

    <id>CE 202</id>

    A java code will parse the files - match course ids and display :

    Course ID : CE 202 [Matching Key]
    Course Name : Electronics [First File]
    Day : Sunday [Second File]

    I'm using the following two links.



    The first link is to create objects (for other stuff) and the second one is to display the schedule in a tabular format.

    Can anyone tell me how I can integrate these two files to create the tabular view of the second link and create objects of only those courses that're offered in the "Second XML FILE".

  2. #2
    Join Date
    Aug 2003
    The second link looks like a link to XML stuff for the web. What is the intended viewing method for this information. If it is on the web and you are planning on using xsl, then you probably don't need java at all. If you need the information in a java program, then the best way would probably be for the program to generate a single xml file with the combined information.

    From my experience, the easiest way to do this in Java would be with XPath. It will allow you to query the document using xpath expressions which you can read about here:

    In order to use XPath theres a few things that you have to do. I have a shell .java file on my computer at home that I can post. It's pretty easy.

    Hope this helps.

Similar Threads

  1. java and xml problems
    By dakkar in forum Java
    Replies: 0
    Last Post: 04-23-2005, 04:25 AM
  2. Replies: 1
    Last Post: 05-02-2002, 07:57 AM
  3. Help student to convert Xml to Java
    By Marco in forum XML
    Replies: 0
    Last Post: 12-11-2000, 10:15 AM
  4. how to use server side xml with java?
    By litstone in forum XML
    Replies: 0
    Last Post: 06-07-2000, 06:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.