I now develop websites and XML interfaces since 7 years, and never, ever came in a situation, where it was really necessary to use the >
for a >
. All disambiguition could so far be handled by quoting <
, &
, "
and '
alone.
Has anyone ever been in a situation (related to, e.g., SGML processing, browser issues, XSLT, ...) where you found it indespensable to escape the greater-than sign with >
?
Update: I just checked with the XML spec, where it says, for example, about character data in section 2.4:
Character Data
[14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)
So even there, the >
isn't mentioned as something special, except from the ending sequence of a CDATA section.
This one single case, where the >
is of any significance, would be the ending of a CDATA section, ]]>
, but then again, if you'd quote it, the quote (i.e., the literal string ]]>
) would land literally in the output (since it's CDATA).
Is is the third person singular of the present tense of be1.
Is is what is known as a state of being verb. State of being verbs do not express any specific activity or action but instead describe existence. The most common state of being verb is to be, along with its conjugations (is, am, are, was, were, being, been).
Translation. He, him, they, them. Gender: Masculine. Singular.
We use for to talk about a purpose or a reason for something: I'm going for some breakfast. I'm really hungry. She leaves on Friday for a 15-day cruise around the Mediterranean.
You don't need to absolutely because almost any XML interpreter will understand what you mean. But still you use a special character without any protection if you do so.
XML is all about semantic, and this is not really semantic compliant.
About your update, you forgot this part :
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.
The use case given in the documentation is more about something like this :
<xmlmarkup>
]]>
</xmlmarkup>
Here the ]]>
part could be a problem with old SGML parsers, so it must be escaped into = ]]>
for compatibilities reasons.
I used one not 19 hours ago to pass a strict xml validator. Another case is when you use them actually in html/xml content text (rather than attributes), like this: <
.
Sure, a lax parser will accept most anything you throw at it, but if you're ever worried about XSS, < is your friend.
Update: Here's an example where you need to escape >
in Firefox:
<?xml version="1.0" encoding="utf-8" ?>
<test>
]]>
</test>
Granted, it still isn't an example of having to escape a lone >
.
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