groovy
  1. groovy
  2. GROOVY-5086

XmlSlurper extremly slow when parsing HTML with DOCTYPE

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.6.4, 1.8.2, 1.8.3
    • Fix Version/s: None
    • Component/s: XML Processing
    • Labels:
    • Environment:
      OSX 10.6, OSX 10.7, Ubuntu 10.04
    • Number of attachments :
      0

      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>''')

        Activity

        Guillaume Laforge made changes -
        Field Original Value New Value
        Status Open [ 1 ] Closed [ 6 ]
        Assignee Guillaume Laforge [ guillaume ]
        Resolution Won't Fix [ 2 ]

          People

          • Assignee:
            Guillaume Laforge
            Reporter:
            Christoph Neuroth
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: