?
Solved

java/html: tool needed to write info into html doc

Posted on 2008-10-01
9
Medium Priority
?
307 Views
Last Modified: 2013-11-23
Is there a 3rd party tool (java based) that writes to a HTML file? The purpose of the HTML file is install instruction for a package.

If not can someone point me to Java code that would perform writing specifics to a HTML doc?
0
Comment
Question by:newbieal
[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
  • 5
  • 4
9 Comments
 
LVL 7

Assisted Solution

by:humanonomics
humanonomics earned 1500 total points
ID: 22613728
Try nekohtml.sourceforge.net

this is used to read/wriite to and from the html files.
0
 
LVL 4

Author Comment

by:newbieal
ID: 22613783
I should add that the install instructions are for solaris packages
0
 
LVL 7

Expert Comment

by:humanonomics
ID: 22614077
I don't see any specific reason, why nekoHtml will not work on solaris. I have used it on windows, linux, unix as well as sun solaris and hp solaris.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Author Comment

by:newbieal
ID: 22615154
All I need is something that generates a standard html template for developers to then use and write install instructions.  It doesn't look like that this parsers does this or at least it seems to be over complicating what I'm looking for.  I just need something very simple.
0
 
LVL 7

Expert Comment

by:humanonomics
ID: 22621390
Can you give an example of what you need to achieve?
0
 
LVL 4

Author Comment

by:newbieal
ID: 22623502
Yes, I have a solaris package that contains sepcific info in a pom.xml file.  This info needs to be taken and passed to my java program and added to the <head> tag of the html document.

I've tried filewriter/bufferedwriter but that just adds info to the end of the html file.  Any code example you could give that accomplishes this would be greatly appreciated.

I thought maybe that there is already a 3rd party tool, such as possibly xml parser that could accomplish this but it seems to be more difficult, but I might be wrong as I'm not too familiar with how xml parser works.
0
 
LVL 4

Author Comment

by:newbieal
ID: 22625133
Would this HTML Parser help with this solution (http://htmlparser.sourceforge.net/).  If yes, how could this be added to my code to make it useful?
0
 
LVL 7

Accepted Solution

by:
humanonomics earned 1500 total points
ID: 22631792
since you want to modify an html file, you would need to do 2 things:
1) you need to read the whole HTML file (if the file is not too big in size). and then modify the contents you wish to.
2) re-write the new contents to the file.

You can achieve this with filewriter/bufferedwriter and also with nekoHTML and HTMLParser (one you pointed out to).

To see and find out how it works, you need to go through the samples they have provided, and also refer to javadocs.

I did not find time to try out html parser at my end as yet.

Thanks
0
 
LVL 4

Author Comment

by:newbieal
ID: 22632937
I do understand what I need to do, but am having a hard time understanding how to use the html parser with filewriter/bufferedwriter.  Could you please provide a code example?
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses
Course of the Month14 days, 10 hours left to enroll

770 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