jQuery in Action, 3rd edition
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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: 9154

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: http://aspose.com/file-tools
subject: Handling Html tag
It's not a secret anymore!