[ 
https://issues.apache.org/jira/browse/XMLBEANS-540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16819728#comment-16819728
 ] 

Srecko Mandelj commented on XMLBEANS-540:
-----------------------------------------

This is my patch in PrettySaveCur inner class in next() method:
{code}
        boolean next() {
            int k;

            if (_txt != null) {
                assert _txt.length() > 0;
                assert !_cur.isText();
                _txt = null;
                _isTextCData = false;
                k = _cur.kind();
            } else {
                int prevKind = k = _cur.kind();

                if (!_cur.next())
                    return false;

                _sb.delete(0, _sb.length());

                assert _txt == null;

                // place any text encountered in the buffer
                if (_cur.isText()) {
                    // _cur.isTextCData() is expensive do it only if 
useCDataBookmarks option is enabled
                    _isTextCData = _useCDataBookmarks && _cur.isTextCData();
                    CharUtil.getString(_sb, _cur.getChars(), _cur._offSrc, 
_cur._cchSrc);
                    _cur.next();
                    //BEGIN PATCH - trim if not an element
                    k = _cur.kind();
                    if (prevKind != ELEM || k != -ELEM) {
                        trim(_sb);
                    }
                    //END PATCH
                }

                k = _cur.kind();
{code}

> Prevent trim of elements when pretty print is used
> --------------------------------------------------
>
>                 Key: XMLBEANS-540
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-540
>             Project: XMLBeans
>          Issue Type: Wish
>            Reporter: Srecko Mandelj
>            Priority: Major
>
> It would be niice to resolve the issue described in XMLBEANS-22. I'm using a 
> local implementation as suggested by [~mattin] in the last comment. Is it 
> possible to make this a permanent fix in one of the future releases? I had 
> problems analyzing logs since space inside element sometimes causes errors in 
> business logic (like the example when search with space fails).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to