[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Java & XML: XML decoding and Java Programming

Posted on 2004-10-10
10
Medium Priority
?
215 Views
Last Modified: 2010-03-31
I've got an xml file with the following syntax:
<?xml version="1.0" encoding="iso-8859-1"?>
<data>
      <topic1>
            <topicname>TOPIC1</topicname>
            <link1>
                  <url>http://www.something.net/</url>
                  <urltext>something</urltext>
                  <description>something somewhat somewhere</description>
                  <imageurl>images/something.jpg</imageurl>
            </link1>
      </topic1>
      <topic2>
            <topicname>TOPIC2</topicname>
            <link1>
                  <url>http://www.somewhat.net/</url>
                  <urltext>somewhat</urltext>
                  <description>somewhat somewhere</description>
                  <imageurl>images/somewhat.jpg</imageurl>
            </link1>
      </topic2>
      <topic3>
            <topicname>TOPIC3</topicname>
            <link1>
                  <url>http://www.somewhere.net/</url>
                  <urltext>somewhere</urltext>            
                  <description>somewhere</description>
                  <imageurl>images/somewhere.jpg</imageurl>
            </link1>
      </topic3>
</data>

I need a Java applet to use on my website (sized 472px * 282px)
Which is supposed to read the xml file and put the links and all it's info onto site.

I've been thinking the applet should have 2 col. one on each side of applet (EAST and WEST)
- The left one should have the <topics> with their <urltext> and should be able to goto the <url> when clicked.
- The right one should update on mouseover the links on the left. It's design would have an image (sized 100px * 73px) on top, followed by "URL: <url>", "Text: <urltext>" and "Description: <description>"

I'm not expecting a complete solution from EE members, but I hope for a little help to get me going.

Thanks in advance.
eX.



0
Comment
Question by:Gaute Rønningen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 12271882
>>The right one should update on mouseover the links on the left.

Could you explain this a bit more?
0
 

Author Comment

by:Gaute Rønningen
ID: 12271988
The right column (JTextArea or something) should dynamically update as one moves the mouse over a link on the left one.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12272026
>>should dynamically update

In what way and why?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:Gaute Rønningen
ID: 12272053
When you move the mouse over a link, the fields on the right should update, using the data from the xml file. To show a description of the link and a preview of the site through an image.

Why? Because I've seen it done on other sites, and want it on mine... (I don't know if they used xml, but still) Sadly I cannot remember which sites...

I'm not sure what you meant by that question, but I tried to answer at the best of my knowledge.

I'll post a simple image of how I want it if you'd like?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12272071
>>I'll post a simple image of how I want it if you'd like?

No - it's OK - i've got the picture now - i'll have a think
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12272094
This is what i'd do:

a. Use a JEditorPane for the left pane
b0. Parse the xml document in a DOM way
b1. Make a Map of descriptions using the links as keys and the descriptions as values
b3. Use the Java transform package to transform the xml into html
c. Add the html as a String to the left pane
d. Add HyperlinkListeners to the links
e. Change the content of the right pane when the HyperlinkListener fires
0
 

Author Comment

by:Gaute Rønningen
ID: 12272142
I feel bad for asking you this, because you probably have more important things to do.
But on the other hand I'm kinda new to Java... Meaning I know some simple things about GUI and JDBC and that's it.

a. I've never used JEditorPane, but I guess the API explains it.
b0. The only thing I've used DOM in before was in VBA. So I could use some kind of tutorial.
b1. Need tutorial.
b3. In the back of my head somewhere.
c. Same as above.
d. Need tutorial.
e. Need tutorial.
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 1000 total points
ID: 12272173
I can point you in the right direction. I would take it bit by bit. Get stand alone parts working that you can later integrate into the complete solution. Start here:

http://javaalmanac.com/egs/

Look at the links right at the end of the page, then you can start looking at JEditorPane in the javax.swing section
0
 

Author Comment

by:Gaute Rønningen
ID: 12276346
I'm sorry, but I've decided to put this project on ice, and focus on school instead.

Anyways I thank you for helping and award you all the points.

(As for my website, I went for a standard Flash menu template, based on XML...)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12284927
8-)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question