logo       

Re: Parsing HTML: msg#00088

java.enhydra.xmlc

Subject: Re: Parsing HTML

I just tried tokenizing the footer string into many strings and adding a new node for each string. It appears to add all of the nodes, but it still cuts off the last part of the document, sometimes in the middle of a tag. Maybe the problem is in the way it's outputting, not with xmlc.

At 12:53 PM 3/26/2003, you wrote:
Actually, now that I think about it further, this doesn't really work for me. I have one servlet that can be used by multiple "sponsors." Each time you pass a different referrer ID to the servlet, it loads a different header and footer, so I couldn't recompile each time.

The way I'm doing it now works just fine for the browsers I've tested, even though the HTML wouldn't pass a validator. The only problem with my method is that it tends to chop off the last part of my footer file when I load it like this:

String footer = readFile(footerFile);
Node footerNode = html.getElementById("footer");
if (footerNode != null) {
((LazyText) footerNode.getFirstChild()).setPreFormattedText(footer);
}

If I output the footer string right after I read it, I can see that it's all there. When viewing the source after the page is generated, it has chopped off part of it.

--
Ben Sinclair
ben@xxxxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise