incubator-kato-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spo...@apache.org
Subject svn commit: r835841 - in /incubator/kato/trunk/org.apache.kato/kato.anttasks: pom.xml src/main/java/org/apache/kato/anttasks/xmlgen/XMLWriter.java
Date Fri, 13 Nov 2009 13:12:06 GMT
Author: spoole
Date: Fri Nov 13 13:12:06 2009
New Revision: 835841

URL: http://svn.apache.org/viewvc?rev=835841&view=rev
Log:
removed extra debugging and changed dep for html document parsing to be non implementation
specific

Modified:
    incubator/kato/trunk/org.apache.kato/kato.anttasks/pom.xml
    incubator/kato/trunk/org.apache.kato/kato.anttasks/src/main/java/org/apache/kato/anttasks/xmlgen/XMLWriter.java

Modified: incubator/kato/trunk/org.apache.kato/kato.anttasks/pom.xml
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.anttasks/pom.xml?rev=835841&r1=835840&r2=835841&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.anttasks/pom.xml (original)
+++ incubator/kato/trunk/org.apache.kato/kato.anttasks/pom.xml Fri Nov 13 13:12:06 2009
@@ -51,12 +51,15 @@
 		<scope>test</scope>
 	</dependency>
 		<dependency>
-		 
-    <groupId>net.sourceforge.nekohtml</groupId>
-    <artifactId>nekohtml</artifactId>
-    <version>1.9.12</version>
-</dependency> 
-
+		    <groupId>net.sourceforge.nekohtml</groupId>
+    		<artifactId>nekohtml</artifactId>
+    		<version>1.9.12</version>
+		</dependency> 
+		<dependency>
+			<groupId>xerces</groupId>
+			<artifactId>xercesImpl</artifactId>
+			<version>2.9.1</version>
+		</dependency>
 	</dependencies>
 	<build>
 		<plugins>

Modified: incubator/kato/trunk/org.apache.kato/kato.anttasks/src/main/java/org/apache/kato/anttasks/xmlgen/XMLWriter.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.anttasks/src/main/java/org/apache/kato/anttasks/xmlgen/XMLWriter.java?rev=835841&r1=835840&r2=835841&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.anttasks/src/main/java/org/apache/kato/anttasks/xmlgen/XMLWriter.java
(original)
+++ incubator/kato/trunk/org.apache.kato/kato.anttasks/src/main/java/org/apache/kato/anttasks/xmlgen/XMLWriter.java
Fri Nov 13 13:12:06 2009
@@ -5,12 +5,15 @@
 import java.io.StringReader;
 import java.io.Writer;
 
-import org.apache.html.dom.HTMLDocumentImpl;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
 import org.cyberneko.html.parsers.DOMFragmentParser;
+import org.w3c.dom.Document;
 import org.w3c.dom.DocumentFragment;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
-import org.w3c.dom.html.HTMLDocument;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 
@@ -31,11 +34,19 @@
 	private static String url="http://java.sun.com/javase/6/docs/api";
 	private Writer model=null;
 	private PrintWriter out=null;
+	private DocumentBuilder builder=null;
 	public XMLWriter(Writer model) {
 		this.model=model;
+		DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
+		try {
+			 builder=factory.newDocumentBuilder();
+		} catch (ParserConfigurationException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
 	}
 	public XMLWriter() {
-		
+		this(null);
 	}
 	public void close() {
 		  write("</javadoc>");
@@ -256,8 +267,9 @@
 		commentText=replaceLinks(commentText);
 		DOMFragmentParser parser = new DOMFragmentParser();
 		
-		HTMLDocument document = new HTMLDocumentImpl();
-		DocumentFragment fragment = document.createDocumentFragment();
+		
+		Document doc=builder.newDocument();
+		DocumentFragment fragment = doc.createDocumentFragment();
 		
         try {
         	parser.parse(new InputSource(new StringReader(commentText)), fragment);
@@ -304,7 +316,7 @@
 					commentText=left+middle+right;
 				}
 			}
-			System.out.println("middle="+middle);
+			
 			
 		}
 		
@@ -430,7 +442,7 @@
 					sb.append(t.text()+" ");
 				}
 				else {
-					System.out.println("tag="+t.getClass());
+					//System.out.println("tag="+t.getClass());
 				}
 			}
 			



Mime
View raw message