What is the difference between encoding and entity references in xml ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Encoding refers to the way a character is represented by a sequence of bytes. It happens at a pretty low level in the processing chain: you read in the bytes and use the encoding to convert to a stream of characters. ASCII, Latin-1, and UTF-8 are all examples of encodings.
Entity references are handled by the XML parser itself. A sequence of characters, starting with
&and ending with;, is used to represent a different sequence of characters (usually just one). This happens at a fairly high level, conceptually “after” the XML parser has determined where tags are. This is why<turns into a plain old less than sign, not the beginning of a tag.