title: Unable to parse xml attributes without using namespace while parsing using Groovy
body: <p>I have an xml response which looks like :-</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
     &lt;soapenv:Body&gt;
        &lt;multiRef xmlns:ns9="http://hero.ar.vixo.in" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns9:IdentityModel"&gt;
           &lt;vixId xsi:type="xsd:int"&gt;13364719&lt;/vixId&gt;
        &lt;/multiRef&gt;
     &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>This response is stored in a <code>String</code> name <code>xmlMsg</code>
  I am trying to parse it as follows:-</p>
  
  <pre><code>def xml = new XmlSlurper().parseText(xmlMsg);
  def vixId = xml.Body.multiRef.vixId.text()
  </code></pre>
  
  <p>But the problem here is that before reading <code>vixId</code> i want to verify if 'type' in <code>multiRef</code> tag is <code>IdentityModel</code></p>
  
  <p>I tried accessing <code>type</code> as follows, but in vain :-</p>
  
  <pre><code>def vixId = xml.Body.multiRef.@type.text()
  </code></pre>
  
  <p>Please note that i am able to access <code>id</code> in <code>multiRef</code> tag using as follows:-</p>
  
  <pre><code> def vixId = xml.Body.multiRef.@id.text()
  </code></pre>
  
  <p>Please help me in accessing <code>type</code> in <code>multiRef</code> tag</p>
  
  <p>Please note that i want to parse the <code>type</code> in <code>multiRef</code> tag without using name space like <code>multiRef.'@xsi:type'</code> because my <code>namespace</code> could change. All i want is that <code>multiRef</code> tag has a attribute <code>type</code> and that has a value of <code>IdentityModel</code>.. Only if this is there then I want to read <code>vixId</code>.
  Also note that with groovy 1.8 i was parsing it without namespace using <code>multiRef.@type</code> but it has stopped working ever since i updated groovy to 2.4.7</p>
  
  <p>The way i was parsing it with groovy 1.8  is :</p>
  
  <pre><code>def xml = new XmlSlurper(factory.newSAXParser().getXMLReader()).parseText(xmlMsg)
  idModel = xml.Body.multiRef.@type.text()
  </code></pre>
  
  <p>PS:- I am fairly new in dealing with xmls </p>