[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit HTMLPage.java,1.19,1.20 NodeUtils.java,1.
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2002-12-24 17:17:36
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit
In directory sc8-pr-cvs1:/tmp/cvs-serv13328/src/com/meterware/httpunit
Modified Files:
HTMLPage.java NodeUtils.java ParsedHTML.java
Removed Files:
HTMLParser.java HTMLParserFactory.java JTidyHTMLParser.java
NekoHTMLParser.java ScriptFilter.java
Log Message:
HTML parser is now settable
Index: HTMLPage.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HTMLPage.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- HTMLPage.java 20 Dec 2002 01:59:47 -0000 1.19
+++ HTMLPage.java 24 Dec 2002 17:17:02 -0000 1.20
@@ -21,6 +21,8 @@
*******************************************************************************************************************/
import com.meterware.httpunit.scripting.NamedDelegate;
import com.meterware.httpunit.scripting.ScriptableDelegate;
+import com.meterware.httpunit.parsing.HTMLParserFactory;
+import com.meterware.httpunit.parsing.DocumentAdapter;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -260,7 +262,11 @@
public void parse( String text, URL pageURL ) throws SAXException, IOException {
- HTMLParserFactory.getHTMLParser().parse( this, pageURL, text );
+ HTMLParserFactory.getHTMLParser().parse( pageURL, text, new DocumentAdapter() {
+ public void setRootNode( Node rootNode ) { HTMLPage.this.setRootNode( rootNode ); }
+ public String getIncludedScript( String srcAttribute ) throws IOException { return HTMLPage.this.getIncludedScript( srcAttribute ); }
+ public Scriptable getScriptableObject() { return HTMLPage.this.getScriptableObject(); }
+ });
}
Index: NodeUtils.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/NodeUtils.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- NodeUtils.java 20 Dec 2002 01:59:47 -0000 1.14
+++ NodeUtils.java 24 Dec 2002 17:17:02 -0000 1.15
@@ -27,6 +27,8 @@
import java.util.Stack;
+import com.meterware.httpunit.parsing.HTMLParserFactory;
+
/**
* Some common utilities for manipulating DOM nodes.
Index: ParsedHTML.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/ParsedHTML.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- ParsedHTML.java 18 Dec 2002 23:58:10 -0000 1.37
+++ ParsedHTML.java 24 Dec 2002 17:17:02 -0000 1.38
@@ -351,7 +351,7 @@
/**
* Specifies the root node for this HTML fragment.
*/
- protected void setRootNode( Node rootNode ) {
+ void setRootNode( Node rootNode ) {
if (_rootNode != null && rootNode != _rootNode )
throw new IllegalStateException( "The root node has already been defined as " + _rootNode + " and cannot be redefined as " + rootNode );
_rootNode = rootNode;
|