package info.spielproject.spiel
package utils

import android.util.Log

object HtmlParser {

  import xml.XML
  import java.io.{ByteArrayInputStream, ByteArrayOutputStream, OutputStreamWriter}
  import org.ccil.cowan.tagsoup._
  import org.xml.sax.InputSource

  def apply(html:String) = {
    val parser = new Parser()
    parser.setProperty(Parser.schemaProperty, new HTMLSchema())
    val input = new InputSource(new ByteArrayInputStream(html.getBytes))
    val output = new ByteArrayOutputStream()
    val writer = new OutputStreamWriter(output)
    val xmlWriter = new XMLWriter(writer)
    xmlWriter.setOutputProperty(XMLWriter.OMIT_XML_DECLARATION, "yes")
    parser.setContentHandler(xmlWriter)
    parser.parse(input)
    val x = XML.loadString(new String(output.toByteArray))
    x
  }

}

package info.spielproject.spiel
package utils

import android.util.Log

object HtmlParser {

  import xml.XML
  import java.io.{ByteArrayInputStream, ByteArrayOutputStream, OutputStreamWriter}
  import org.ccil.cowan.tagsoup._
  import org.xml.sax.InputSource

  def apply(html:String) = {
    val parser = new Parser()
    parser.setProperty(Parser.schemaProperty, new HTMLSchema())
    val input = new InputSource(new ByteArrayInputStream(html.getBytes))
    val output = new ByteArrayOutputStream()
    val writer = new OutputStreamWriter(output)
    val xmlWriter = new XMLWriter(writer)
    xmlWriter.setOutputProperty(XMLWriter.OMIT_XML_DECLARATION, "yes")
    parser.setContentHandler(xmlWriter)
    parser.parse(input)
    Log.d("spielcheck", "HTML: "+html)
    XML.loadString(new String(output.toByteArray))
  }

}

--- 
+++ 
@@ -20,8 +20,8 @@
     xmlWriter.setOutputProperty(XMLWriter.OMIT_XML_DECLARATION, "yes")
     parser.setContentHandler(xmlWriter)
     parser.parse(input)
-    Log.d("spielcheck", "HTML: "+html)
-    XML.loadString(new String(output.toByteArray))
+    val x = XML.loadString(new String(output.toByteArray))
+    x
   }
 
 }
Remove debugging output from HTML parser.

--HG--
extra : convert_revision : 25c5c9b2d23090e7270daee1ab7ecb9cf34e2a2c
