--- Chris Pratt <[EMAIL PROTECTED]> wrote: > What I'm trying to do is read a stream of HTML and make changes to > certain tags ,like adding a target="_blank" to the <a> tags and > setting the src attributes for <img>, <link> and others so they can't > be loaded, for a mail viewer web application. I'd prefer not to > change the stream in any ways other than the intentional changes, so > that I don't run into any weird bugs down the line. But I haven't > found a good technique to do that yet.
While I'd imagine there are HTML libraries that don't convert entities (you might check out http://htmlparser.sourceforge.net/, at least) you can always use regular expressions. If your input is well-formed I'd imagine that XSLT would also work, but then you'd have to use XSLT, and we'd all stand around and laugh and point. I don't know if you're trying to do this from within a Java application or as a standalone tool, but if standalone, I'd probably just use one of the [J]Ruby alternatives; I do a lot of massaging with a combination of regex and some of the XML/HTML libraries. Dave --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]