public String getIncludedScript( String srcAttribute ) { try { return _documentAdapter.getIncludedScript( srcAttribute ); } catch (IOException e) { throw new ScriptException( e ); } }
private ScriptingHandler getScriptingHandler() { _documentAdapter.setDocument( (HTMLDocument) getCurrentElement().getOwnerDocument() ); return _documentAdapter.getScriptingHandler(); }
public void parse( URL pageURL, String pageText, DocumentAdapter adapter ) throws IOException, SAXException { try { Document jtidyDocument = getParser( pageURL ).parseDOM( new ByteArrayInputStream( pageText.getBytes( UTF_ENCODING ) ), null ); HTMLDocument htmlDocument = new HTMLDocumentImpl(); NodeList nl = jtidyDocument.getChildNodes(); for (int i = 0; i < nl.getLength(); i++) { Node importedNode = nl.item(i); if (importedNode.getNodeType() != Node.DOCUMENT_TYPE_NODE) htmlDocument.appendChild( htmlDocument.importNode( importedNode, true ) ); } adapter.setDocument( htmlDocument ); } catch (UnsupportedEncodingException e) { throw new RuntimeException( "UTF-8 encoding failed" ); } }
public void parse( URL pageURL, String pageText, DocumentAdapter adapter ) throws IOException, SAXException { try { Document jtidyDocument = getParser( pageURL ).parseDOM( new ByteArrayInputStream( pageText.getBytes( UTF_ENCODING ) ), null ); HTMLDocument htmlDocument = new HTMLDocumentImpl(); NodeList nl = jtidyDocument.getChildNodes(); for (int i = 0; i < nl.getLength(); i++) { Node importedNode = nl.item(i); if (importedNode.getNodeType() != Node.DOCUMENT_TYPE_NODE) htmlDocument.appendChild( htmlDocument.importNode( importedNode, true ) ); } adapter.setDocument( htmlDocument ); } catch (UnsupportedEncodingException e) { throw new RuntimeException( "UTF-8 encoding failed" ); } }
private ScriptingHandler getScriptingHandler() { _documentAdapter.setDocument( (HTMLDocument) getCurrentElement().getOwnerDocument() ); return _documentAdapter.getScriptingHandler(); }
public void parse( URL pageURL, String pageText, DocumentAdapter adapter ) throws IOException, SAXException { try { Document jtidyDocument = getParser( pageURL ).parseDOM( new ByteArrayInputStream( pageText.getBytes( UTF_ENCODING ) ), null ); HTMLDocument htmlDocument = new HTMLDocumentImpl(); NodeList nl = jtidyDocument.getChildNodes(); for (int i = 0; i < nl.getLength(); i++) { Node importedNode = nl.item(i); if (importedNode.getNodeType() != Node.DOCUMENT_TYPE_NODE) htmlDocument.appendChild( htmlDocument.importNode( importedNode, true ) ); } adapter.setDocument( htmlDocument ); } catch (UnsupportedEncodingException e) { throw new RuntimeException( "UTF-8 encoding failed" ); } }
public String getIncludedScript( String srcAttribute ) { try { return _documentAdapter.getIncludedScript( srcAttribute ); } catch (IOException e) { throw new ScriptException( e ); } }
private ScriptingHandler getScriptingHandler() { _documentAdapter.setDocument( (HTMLDocument) getCurrentElement().getOwnerDocument() ); return _documentAdapter.getScriptingHandler(); }
/** * parse the given URL with the given pageText using the given document adapter * @param pageURL * @param pageText * @param adapter */ public void parse( URL pageURL, String pageText, DocumentAdapter adapter ) throws IOException, SAXException { try { NekoDOMParser parser = NekoDOMParser.newParser( adapter, pageURL ); parser.parse( new InputSource( new StringReader( pageText ) ) ); Document doc=parser.getDocument(); adapter.setDocument( (HTMLDocument)doc ); } catch (NekoDOMParser.ScriptException e) { throw e.getException(); } }
public String getIncludedScript( String srcAttribute ) { try { return _documentAdapter.getIncludedScript( srcAttribute ); } catch (IOException e) { throw new ScriptException( e ); } }
/** * parse the given URL with the given pageText using the given document adapter * @param pageURL * @param pageText * @param adapter */ public void parse( URL pageURL, String pageText, DocumentAdapter adapter ) throws IOException, SAXException { try { NekoDOMParser parser = NekoDOMParser.newParser( adapter, pageURL ); parser.parse( new InputSource( new StringReader( pageText ) ) ); Document doc=parser.getDocument(); adapter.setDocument( (HTMLDocument)doc ); } catch (NekoDOMParser.ScriptException e) { throw e.getException(); } }
/** * parse the given URL with the given pageText using the given document adapter * @param pageURL * @param pageText * @param adapter */ public void parse( URL pageURL, String pageText, DocumentAdapter adapter ) throws IOException, SAXException { try { NekoDOMParser parser = NekoDOMParser.newParser( adapter, pageURL ); parser.parse( new InputSource( new StringReader( pageText ) ) ); Document doc=parser.getDocument(); adapter.setDocument( (HTMLDocument)doc ); } catch (NekoDOMParser.ScriptException e) { throw e.getException(); } }