If I want to to label some buttons with ">" and "<" symbols, what's the correct way to escape them out in the XML file? The presence of either ">" or "&" (as in ">") produces "invalid token" errors.
Thanks in advance.
The escape character for XML is the ampersand, &. The other dangerous character is the left angle bracket, the “less than,” <. Mostly to be symmetric, we also handle the right angle bracket, the “greater than,” >, similarly.
Note: The square brackets ( [ ] ) in the Edit Element dialog box represent XML opening and closing tags. To type a square bracket in the text of your design, use the following codes: &left; for “[“ or &right; for “]”. Select the XML element for which you want to edit the text content in the XML Tree.
Square brackets do not need a specific notation in XML but they have a special meaning when used in XPath expressions for XSL transformations.
Either specify those characters like this:
< = < > = >
Or use a CDATA section and put those characters inside:
<![CDATA[<]]> <![CDATA[>]]>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With