FreeAndNil opened a new issue, #361:
URL: https://github.com/apache/logging-log4net/issues/361
`XmlLayout` and `XmlLayoutSchemaLog4J` write whitespace characters in a form
an XML parser changes on
read, without a marker:
- Message, exception text and the log4j NDC are written with literal line
breaks. A parser
normalizes CR and CR LF to LF (XML 1.0, 2.11), so `a\rb`, `a\r\nb` and
`a\nb` all read back as
`a\nb`. On `netstandard2.0` the writer already replaces them before the
file. ANT-2026-HQWYRAWL.
- On `net462`, `XmlTextWriter` writes a tab in an attribute (property values
and names, identity) as
a literal tab, which attribute-value normalization turns into a space:
`alice<TAB>admin` reads
back as `alice admin`. `netstandard2.0` writes `	`. ANT-2026-8WPIUIID.
Nothing is forged or lost; one whitespace character reads back as another.
Both since 1.2.9.
Proposed fix: write every CR and LF in element text as a character reference
(`
`, `
`), so
text with a line break goes out escaped instead of as CDATA, and write a tab
in an attribute as
`	` on `net462` too. Line breaks then read back exactly; the file no
longer has physical line
breaks inside a record.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]