Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Liutauras Vilda
Ron McLeod
Sheriffs:
Jeanne Boyarsky
Devaka Cooray
Paul Clapham
Saloon Keepers:
Scott Selikoff
Tim Holloway
Piet Souris
Mikalai Zaikin
Frits Walraven
Bartenders:
Stephan van Hulst
Carey Brown
Forum:
Beginning Java
Handling Html tag
Hui Zhao
Ranch Hand
Posts: 117
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
Posts: 228
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Could you post more details about your question?
Joe Ess
Bartender
Posts: 9626
16
I like...
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
]
Why am I so drawn to cherry pie? I can't seem to stop. Save me tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Help Clean up This Code
Can you read this?
Hiding child element - IE works, but Mozilla no
How to compute the count of html_tag each line?
Embedding Lists in XHTML
More...