title: Castor read an attribute of a text element
body: <p>I would like to know how to map this using castor mappings (version 0.9.9.1).</p>
  <pre><code>&lt;Classifica&gt;
      &lt;Livello nome=&quot;812&quot;&gt;1&lt;/Livello&gt;
  &lt;/Classifica&gt;
  </code></pre>
  <p>What I need it the value of the <strong>nome</strong> attribute.</p>
  <p>I've tried this:</p>
  <pre><code>&lt;class name=&quot;it.ClassificaIDT&quot; auto-complete=&quot;true&quot;&gt;
      &lt;map-to xml=&quot;Classifica&quot;/&gt;
      &lt;field name=&quot;livello&quot;
             type=&quot;it.LivelloIDT&quot;
             container=&quot;false&quot;&gt;
        &lt;bind-xml name=&quot;Livello&quot;/&gt;
      &lt;/field&gt;
    &lt;/class&gt;
    &lt;class name=&quot;it.LivelloIDT&quot; auto-complete=&quot;true&quot;&gt;
      &lt;map-to xml=&quot;Livello&quot;/&gt;
      &lt;field name=&quot;nome&quot;&gt;
        &lt;bind-xml name=&quot;nome&quot; node=&quot;attribute&quot;/&gt;
      &lt;/field&gt;
    &lt;/class&gt;
  </code></pre>
  <p>My class is:</p>
  <pre><code>package it;
  
  public class ClassificaIDT {
      private LivelloIDT livello;
  
      public LivelloIDT getLivello() {
          return livello;
      }
  
      public void setLivello(LivelloIDT livello) {
          this.livello = livello;
      }
  }
  </code></pre>
  <p>The above gives this error:</p>
  <pre><code>Caused by: Illegal Text data found as child of: Livello
    value: &quot;1&quot;{file: [not available]; line: 42; column: 56}
      at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:671)
      at it.bz.prov.egov.foundation.fascicoloinformatico.service.eprocs.XMLConverter.createOutputForEProcsWebService(XMLConverter.java:121)
      ... 148 more
  Caused by: org.xml.sax.SAXException: Illegal Text data found as child of: Livello
    value: &quot;1&quot;
      at org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:889)
  </code></pre>
  <p>How can I ignore the value '1'? Or even better, how to map it to a class property ?</p>
  <p>Thank you.</p>