Java Reference
In-Depth Information
ParseHTML parse = new ParseHTML(is);
StringBuilder buffer = new StringBuilder();
int ch;
while ((ch = parse.read()) != -1)
{
if (ch == 0)
{
HTMLTag tag = parse.getTag();
if (tag.getName().equalsIgnoreCase("script")
&& tag.getAttributeValue("src")!=null)
{
String src = tag.getAttributeValue("src");
URL u = new URL(url,src);
String include = downloadPage(u);
buffer.append("<script>");
buffer.append(include);
buffer.append("</script>");
}
else
{
buffer.append(tag.toString());
}
}
else
{
buffer.append((char)ch);
}
}
System.out.println(buffer.toString());
}
/**
* The main method, create a new instance of the object and call
* process.
* @param args not used.
*/
public static void main(String args[])
{
try
{
Includes parse = new Includes();
parse.process();
} catch (Exception e)
{
Search WWH ::




Custom Search