4 ms·
But what if the original JSON had a string that looks like XML? Does {"endTag": "</json:string>"} become <json:string> </json:string> </json:string> ?
by sp332 12y ago
But what if the original JSON had a string that looks like XML? Does {"endTag": "</json:string>"} become <json:string> </json:string> </json:string> ?
- masklinn 12y agoOf course not, it's either embedded in a CDATA section or the characters are escaped to the relevant entities: http://www.w3.org/TR/xml/#syntax http://www.w3.org/TR/xml/#syntax > The ampersand character (&) and the left angle bracket (<) must not appear in their literal form, except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. If they are needed elsewhere, they must be escaped using either numeric character references or the strings " & " and " < " respectively. The right angle bracket (>) may be represented using the string " > ", and must, for compatibility, be escaped using either " > " or a character reference when it appears in the string " ]]> " in content, when that string is not marking the end of a CDATA section.
- bitwize 12y agoThey'd probably escape out the angle brackets with entities. Sorry, Bobby Tables.
- sp332 12y agoProbably, well hopefully, sure. But I want to know whether they did, and whether the technique is fragile.
- figglesonrails 12y agoI don't really understand why you are being down voted for a technical question. It seems like answering it without giving a downvote as a snarky "ISN'T IT OBVIOUS?" would be sufficient.