Skip to content

Trim spaces! OMG! #73

Closed
Closed
@isergey

Description

@isergey

" " != ""
May be remove this trim, because in terms of XML is wrong. There is no way to restore the information, encoded in the spaces!

public Object nextContent() throws JSONException {
    char c;
    StringBuffer sb;
    c = next();
    /*
     * do { c = next(); } while
     * (Character.isWhitespace(c));
     */
    if (c == 0) {
        return null;
    }
    if (c == '<') {
        return XML.LT;
    }
    sb = new StringBuffer();
    for (;;) {
        if (c == '<' || c == 0) {
            back();
            //return sb.toString().trim();
            return sb.toString();
        }
        if (c == '&') {
            sb.append(nextEntity(c));
        } else {
            sb.append(c);
        }
        c = next();
    }
}

Also, in transformation JSONObject -> Xml.toString - > Xml.toJSONObject lost leading zeros.
It would be logical not to parse a string containing a number as numerical types, and provide the user to get them as numerical types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions