Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape according to Canonical XML 1.0 #54

Merged
merged 1 commit into from
Aug 4, 2014
Merged

Conversation

jscheid
Copy link
Contributor

@jscheid jscheid commented Jul 28, 2014

First and foremost, this change allows adding linefeeds, tabs and carriage returns to attribute values. This was not possible before, since such characters did not get escaped and without escaping a conforming XML reader will replace them by blanks.

While at it, this change escapes attribute values, text, and comments according to the Canonical XML 1.0 specification. In particular, in attribute values greater-than and single quote no longer get escaped; in element values, single and double quotes no longer get escaped but carriage return does get escaped; and in comments, nothing gets escaped.

See <http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping>.

First and foremost, this change allows adding linefeeds, tabs and
carriage returns to attribute values.  This was not possible before,
since such characters did not get escaped and without escaping a
conforming XML reader will replace them by blanks. [1]

While at it, this change escapes attribute values, text, and comments
according to the Canonical XML 1.0 specification.  In particular, in
attribute values greater-than and single quote no longer get escaped; in
element values, single and double quotes no longer get escaped but
carriage return does get escaped; and in comments, nothing gets escaped.

[1] http://www.w3.org/TR/2004/REC-xml-20040204/#AVNormalize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants