XML parsing not storing entire value on random nodes
<p>I have an android app that, via a service, downloads an xml file from a web server, parses the data and updates a database via a content provider. This all works fine.</p>

<p>My problem is that on some of the nodes of the xml file it will not process the entire string it contains. I have a xml structured like...</p>

<pre><code>&lt;books&gt;
    &lt;book&gt;
        &lt;author&gt;Test Author&lt;/author&gt;
        &lt;title&gt;Example title&lt;/title&gt;
        &lt;datestamp&gt;201212251300&lt;/datestamp&gt;
    &lt;/book&gt;
    about 30 more book nodes...
&lt;/books&gt;
</code></pre>

<p>I use the datestamp value (which is a YYYYMMDDHHMM value) to order the books but occasionally it will only save 4 or 5 characters of the datestamp on 1 or 2 of the books, which then messes up the sorting on the column.</p>

<p>I am probably going to change the datestamp column to a single number to get round it but has anyone seen this before?</p>

<p>Thanks.</p>

<p>Snippet from the DefaultHandler class showing where the value is added to the ContentValues object...</p>

<pre><code>@Override
public void characters(char ch[], int start, int length) {
    if(this.in_datestamp_tag){
        cv.put(DbAdapter.TBL_BOOK_ROW_DATESTAMP, new String(ch, start, length));
    }
} 
</code></pre>
