Hi,
I have to insert certain lines of html code in already existing file of html using java.I have to add certain things in head and some things in body.Can u help me??
Regards
Vasavi.
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hi,
I have to insert certain lines of html code in already existing file of html using java.I have to add certain things in head and some things in body.Can u help me??
Regards
Vasavi.
We can try to help you. Post the code you are working on and explain what the problem with it is.
Post some samples of what the program does now to show the problem you are having with it.
If you don't understand my answer, don't ignore it, ask a question.
can u plz relpy me asap
What have you tried?
If you don't understand my answer, don't ignore it, ask a question.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>
</title>
</head>
<body>
<div class="stl_06"><span class="stl_05">Chrome 30 and higher, and I.E. 9.0 and higher. </span></div>
</body>
</html>
I want to add some more tags in head and body part, using java.In java i am parsing the html file using html parser and i want to add html code from here.How can I add html at particular position
Please post the code you are having problems with.
If you don't understand my answer, don't ignore it, ask a question.
nodeTextTagNode) node).toTagHtml();
try
{
File f=new File("/Users/Channels/Desktop/Vasavi/untitled folder/HtmlExtractor/TestHtml/LiveFile.html");
fw=new FileWriter(f,true);
bw=new BufferedWriter(fw);
if(nodeText.equalsIgnoreCase("<head>"))
{
String data="<hello>";
bw.write(data);
}
When i am adding like this it is added in the last of my html page but i want to add it in the head.nodeText conatins all the tags in my html.
What is the head.nodeText? What package and classes is that in? Does its API doc have methods that do what you want to do?i want to add it in the head.nodeText conatins all the tags in my html
Can you post complete code that compiles, executes and shows the problem?
Be sure to wrap your code with code tags:
[code=java]
YOUR CODE GOES HERE
[/code]
to get highlighting and preserve formatting.
If you don't understand my answer, don't ignore it, ask a question.