title: Grails/Groovy problem with XmlSlurper .. help
body: <p>Using grails 1.2.2 with groovy 1.6.8 ..  Reading a a web service and trying to process response  ..   </p>
  
  <p>Response is shown below and validates as correct xml  .. (sorry for length) .. </p>
  
  <pre><code>&lt;soap:Body&gt;
    &lt;AddProductEventResponse xmlns="http://tempuri.org/"&gt;
       &lt;AddProductEventResult&gt;
          &lt;xs:schema id="AddProductEventResult" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"&gt;
             &lt;xs:element name="AddProductEventResult" msdata:IsDataSet="true" msdata:UseCurrentLocale="true"&gt;
                &lt;xs:complexType&gt;
                   &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
                      &lt;xs:element name="AddProductEventResult"&gt;
                         &lt;xs:complexType&gt;
                            &lt;xs:sequence&gt;
                               &lt;xs:element name="ErrorCode" type="xs:string" minOccurs="0"/&gt;
                               &lt;xs:element name="ErrorNumber" type="xs:int" minOccurs="0"/&gt;
                               &lt;xs:element name="ErrorDesc" type="xs:string" minOccurs="0"/&gt;
                            &lt;/xs:sequence&gt;
                         &lt;/xs:complexType&gt;
                      &lt;/xs:element&gt;
                   &lt;/xs:choice&gt;
                &lt;/xs:complexType&gt;
             &lt;/xs:element&gt;
          &lt;/xs:schema&gt;
          &lt;diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;
             &lt;AddProductEventResult xmlns=""&gt;
                &lt;AddProductEventResult diffgr:id="AddProductEventResult1" msdata:rowOrder="0" diffgr:hasChanges="inserted"&gt;
                   &lt;ErrorCode&gt;S&lt;/ErrorCode&gt;
                   &lt;ErrorNumber&gt;0&lt;/ErrorNumber&gt;
                   &lt;ErrorDesc&gt;Success&lt;/ErrorDesc&gt;
                &lt;/AddProductEventResult&gt;
             &lt;/AddProductEventResult&gt;
          &lt;/diffgr:diffgram&gt;
       &lt;/AddProductEventResult&gt;
    &lt;/AddProductEventResponse&gt;
  &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>I try to parse this using   </p>
  
  <p>def myXml = new XmlSlurper().parseText(result) </p>
  
  <p>where result is the above message and i get an error ... </p>
  
  <p>2010-06-19 06:08:03,665 [http-8080-2] ERROR errors.GrailsExceptionResolver  - Premature end of file. 
  org.xml.sax.SAXParseException: Premature end of file. 
          at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231) 
          at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) </p>
  
  <p>which is the above xmlSlurper statement  .. </p>
  
  <p>If i copy and run from groovyConsole i don't have the problem .. I created a stripped down Grails project 
  and ran it from there without problems either .. I'm getting a little bit desperate to get this sorted (have posted on Grails site to) so has anyone any idea ?   </p>