Subject: bug#4950: `xml-parse-file' returns incorrect results strings after `>' before `<' when CR\LF TAB+

From: Chong Yidong <[email-masked]>
Date: Sun, 01 Jul 2012 19:22:33 +0800

MON KEY <[email-masked]> writes:

> <ELEMENT attr1="a1" attr2="a2" attr3="a3" attr4="a4" attr5="a5">CR\LF
> TAB TAB TAB <NEXT-NODE>
>
> Returns (:NOTE with my pp-ing to help clarify the problem):
>
> (ELEMENT nil
>          ((attr1 . "a1")
>           (attr2 . "a2")
>           (attr3 . "a3")
>           (attr4 . "a4")
>           (attr5 . "a5") "
>             " ;; <-i.e. (mapconcat #'char-to-string '(32 10 9 9 9) "")
>           (NEXT-NODE nil (...
>
> Is it if fair/safe to assume that where these types of sequences occur
> they are not part of the XML and can be removed with a regexp?

No.

XML 1.0 Recommendation, Section 2.10 White Space Handling:

"An XML processor MUST always pass all characters in a document that are
not markup through to the application."