2009-04-22

黏膠/水管

這兩段程式要怎麼黏/連起來?

private static void dump(List<HtmlElement> elements)
{
for (HtmlElement i : elements)
{
System.out.println("<!-------------------->");
System.out.println(i.asXml());
}
}

private static void wrap_and_save_html(String html, String path)
{
try {
FileWriter fw = new FileWriter(path);
fw.write("<html>");
fw.write(html);
fw.write("</html>");
fw.close();
} catch (IOException e) {
e.printStackTrace();
}
}

No comments: