Re: Escape sequence for " symbol - mistake in the book
Right, I understand they are used by the Jack language for string constants, but when converting Jack to XML in this project, we are told to eliminate the double quotes. So I'm just wondering why the book talks about escaping double quotes when they do not appear in our XML file at all
Re: Escape sequence for " symbol - mistake in the book
This post was updated on .
You are right, the double quotes would be eliminated from the string literal, however symbols like <,> and & can occur and would be illegal XML syntax.
For example:
if (x < 5) ...
The < symbol should be represented as
<symbol> < </symbol>
Since < and > is exclusively used to indicate opening and closing of hierarchies in XML. Same goes for & which is an escape symbol, so it has to be escaped as well.