File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Handling Html tag" Watch "Handling Html tag" New topic

Handling Html tag

Hui Zhao
Ranch Hand

Joined: Jul 09, 2007
Posts: 116

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.
Saathvik Reddy
Ranch Hand

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

Joined: Oct 29, 2001
Posts: 9190

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.

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Handling Html tag
It's not a secret anymore!