Java 类org.w3c.dom.html2.HTMLDocument 实例源码
项目:javify
文件:Demo.java
public static void main(String[] args)
{
try
{
// Create a parser, using our DTD.
DomHTMLParser p = new DomHTMLParser(HTML_401F.getInstance());
HTMLDocument d = p.parseDocument(new StringReader(input));
// Print the input HTML.
System.out.println(input);
// Print the parsed data structure.
print(System.out, d, 0);
}
catch (IOException ex)
{
ex.printStackTrace();
}
}
项目:javify
文件:DomHTMLParser.java
/**
* Read the document, present in the given stream, and
* return the corresponding {@link HTMLDocument}.
*
* @param input a stream to read from.
* @return a document, reflecting the structure of the provided HTML
* text.
*
* @throws IOException if the reader throws one.
*/
public HTMLDocument parseDocument(Reader input)
throws IOException
{
try
{
document = new DomHTMLDocument();
document.setCheckWellformedness(false);
document.setCheckingCharacters(false);
cursor = document;
parse(input);
DomHTMLDocument h = document;
document = null;
return h;
}
catch (Exception ex)
{
ex.printStackTrace();
throw new IOException("Exception: " + ex.getMessage());
}
}
项目:jvm-stm
文件:Demo.java
public static void main(String[] args)
{
try
{
// Create a parser, using our DTD.
DomHTMLParser p = new DomHTMLParser(HTML_401F.getInstance());
HTMLDocument d = p.parseDocument(new StringReader(input));
// Print the input HTML.
System.out.println(input);
// Print the parsed data structure.
print(System.out, d, 0);
}
catch (IOException ex)
{
ex.printStackTrace();
}
}
项目:jvm-stm
文件:DomHTMLParser.java
/**
* Read the document, present in the given stream, and
* return the corresponding {@link HTMLDocument}.
*
* @param input a stream to read from.
* @return a document, reflecting the structure of the provided HTML
* text.
*
* @throws IOException if the reader throws one.
*/
public HTMLDocument parseDocument(Reader input)
throws IOException
{
try
{
document = new DomHTMLDocument();
document.setCheckWellformedness(false);
document.setCheckingCharacters(false);
cursor = document;
parse(input);
DomHTMLDocument h = document;
document = null;
return h;
}
catch (Exception ex)
{
ex.printStackTrace();
throw new IOException("Exception: " + ex.getMessage());
}
}
项目:JamVM-PH
文件:Demo.java
public static void main(String[] args)
{
try
{
// Create a parser, using our DTD.
DomHTMLParser p = new DomHTMLParser(HTML_401F.getInstance());
HTMLDocument d = p.parseDocument(new StringReader(input));
// Print the input HTML.
System.out.println(input);
// Print the parsed data structure.
print(System.out, d, 0);
}
catch (IOException ex)
{
ex.printStackTrace();
}
}
项目:JamVM-PH
文件:DomHTMLParser.java
/**
* Read the document, present in the given stream, and
* return the corresponding {@link HTMLDocument}.
*
* @param input a stream to read from.
* @return a document, reflecting the structure of the provided HTML
* text.
*
* @throws IOException if the reader throws one.
*/
public HTMLDocument parseDocument(Reader input)
throws IOException
{
try
{
document = new DomHTMLDocument();
document.setCheckWellformedness(false);
document.setCheckingCharacters(false);
cursor = document;
parse(input);
DomHTMLDocument h = document;
document = null;
return h;
}
catch (Exception ex)
{
ex.printStackTrace();
throw new IOException("Exception: " + ex.getMessage());
}
}
项目:classpath
文件:Demo.java
public static void main(String[] args)
{
try
{
// Create a parser, using our DTD.
DomHTMLParser p = new DomHTMLParser(HTML_401F.getInstance());
HTMLDocument d = p.parseDocument(new StringReader(input));
// Print the input HTML.
System.out.println(input);
// Print the parsed data structure.
print(System.out, d, 0);
}
catch (IOException ex)
{
ex.printStackTrace();
}
}
项目:classpath
文件:DomHTMLParser.java
/**
* Read the document, present in the given stream, and
* return the corresponding {@link HTMLDocument}.
*
* @param input a stream to read from.
* @return a document, reflecting the structure of the provided HTML
* text.
*
* @throws IOException if the reader throws one.
*/
public HTMLDocument parseDocument(Reader input)
throws IOException
{
try
{
document = new DomHTMLDocument();
document.setCheckWellformedness(false);
document.setCheckingCharacters(false);
cursor = document;
parse(input);
DomHTMLDocument h = document;
document = null;
return h;
}
catch (Exception ex)
{
ex.printStackTrace();
throw new IOException("Exception: " + ex.getMessage());
}
}