*
The moose likes Beginning Java and the fly likes Handling Html tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Handling Html tag" Watch "Handling Html tag" New topic
Author

Handling Html tag

Hui Zhao
Ranch Hand

Joined: Jul 09, 2007
Posts: 116
Hello,

I have a html file that is like

I want to add an id to each line.
How to add it with html tag function?
I am not strong on it.

I need a piece of codes.
Thanks
Saathvik Reddy
Ranch Hand

Joined: Jun 03, 2005
Posts: 228
Could you post more details about your question?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8834
    
    7

The HTML parser provided in the JDK can run through a document and fire off events for each tag but it cannot edit the document. Have a look at HTMLEditorKit, which has methods for inserting and deleting content.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Handling Html tag
 
Similar Threads
Can you read this?
Embedding Lists in XHTML
How to compute the count of html_tag each line?
Hiding child element - IE works, but Mozilla no
Help Clean up This Code