A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Java
»
Beginning Java
Author
Handling Html tag
Hui Zhao
Ranch Hand
Joined: Jul 09, 2007
Posts: 116
posted
Oct 10, 2007 19:33:00
0
Hello,
I have a html file that is like
<h5>Views</h5> <div class="pBody"> <ul> <li id="ca-nstab-main" class="selected"><a href="/wiki/Hacker" title="View the content page [c]" accesskey="c">Article</a></li>
I want to add an id to each line.
How to add it with html tag function?
I am not strong on it.
HTMLEditorKit.ParserCallback handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos)
I need a piece of codes.
Thanks
Saathvik Reddy
Ranch Hand
Joined: Jun 03, 2005
Posts: 228
posted
Oct 11, 2007 07:11:00
0
Could you post more details about your question?
Joe Ess
Bartender
Joined: Oct 29, 2001
Posts: 8261
I like...
posted
Oct 11, 2007 08:06:00
0
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
]
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Handling Html tag
Similar Threads
Hiding child element - IE works, but Mozilla no
Help Clean up This Code
Embedding Lists in XHTML
Can you read this?
How to compute the count of html_tag each line?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter