#202 Line breaks are not properly escaped in attributes

dom4j_1.6.x
open
nobody
1
2014-07-10
2012-10-12
Thomas Mortagne
No

According to http://www.w3.org/TR/xml/#AVNormalize all line breaks are normalized to white space by a XML parser so in order to keep them they need to be escaped by the serailizer.

The bug is in XMLWriter#escapeAttributeEntities:

                case '\t':
                case '\n':
                case '\r':

                    // don't encode standard whitespace characters
                    break;

which does not make much sense.

Discussion