How to remove HTML markup tags from the stream as it is read ?

Discussion in 'Java' started by Victoria, Mar 1, 2004.

  1. Victoria

    Victoria Guest

    How to remove HTML markup tags from the stream as it is read ?
    Victoria, Mar 1, 2004
    1. Advertisements

  2. Hi Victoria,

    Your post was pretty sparse, but here's my attempt to answer..

    As you are reading in characters from the stream, if you can assume that the
    HTML is valid, well-formed XHTML, then this is a relatively easy task.

    It's just a matter of figuring out if you are inside of < and > , or if you
    are outside.

    Create another output stream that you will write your results to.
    Start parsing your input stream, and for each character you encounter:

    if it is outisde of < and > then print it to the output stream

    You are going to need to post more information about your problem, though,
    if you need more direction than that. Posting what you have already
    attempted is usually a very good way to elicit responses from the group.

    Collin VanDyck, Mar 1, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.