This project is read-only.
1

Resolved

XML Field data truncated.. Possible Bug??..

description

Items of data in the XML response from the GSA are being truncated when containing characters requiring a html encode.
This is happening in methods "private void Characters" and "private void characters" in the XMLParser class.
 

*** Source Code From XMLParser class ***
    private void Characters(string buf, int offset, int len)
    {
        buf = buf.Replace("&", "&amp;").Replace("<", "&lt;").Replace(">", "&gt;").Replace("'", "&apos;").Replace("\"", """);
        sb.Append(buf + LineEnd);
        this.characters(buf, offset, len);
    }
 
    public void characters(string ch, int start, int length)
    {
        contentBuff.Append(ch, start, length);
    }

 
Calling Characters()
string buf = one two <b>three</b>
int offset = 0
int len = 20
 
Replace statement changes contents of buf to;
one two <b>three</b>
 
New length = 32
...but void characters is then called with the original length of 20 characters which results in only 20 characters of the field being bound to the result object.
 
Would be great to get this bug fixed. Unable to use the API at the moment as data is being truncated and also causing invalid markup on page. i.e opening <b> tag with no closing tag.
 
Thanks, Adam

comments

mbcizmar wrote Mar 3, 2008 at 4:43 AM

Fixed in v.1.3 Thanks Adam.

wrote Mar 3, 2008 at 4:43 AM

wrote Feb 14, 2013 at 3:30 AM

wrote May 16, 2013 at 8:12 AM

wrote May 16, 2013 at 8:12 AM

wrote Jun 14, 2013 at 7:54 AM