Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-5086

XmlSlurper extremly slow when parsing HTML with DOCTYPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.6.4, 1.8.2, 1.8.3
    • None
    • XML Processing
    • OSX 10.6, OSX 10.7, Ubuntu 10.04

    Description

      When parsing a XHTML document with a DOCTYPE declaration, the XMLSlurper parses for about two minutes. I reproduced this on several different groovy versions on OS X and Linux, but not using the groovy web console on appspot.com. This has also been encountered by some on the grails user mailing list earlier this year: http://grails.1312388.n4.nabble.com/XMLSlurper-really-slow-reading-parsing-html-xml-file-td3433305.html

      Minimal example to trigger this:

      new XmlSlurper().parseText('''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de"><head><title>slurp</title></head><body /></html>''')

      Attachments

        Activity

          People

            guillaume Guillaume Sauthier
            c089 Christoph Neuroth
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: