Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
XML
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Escaping === XML provides ''[[Escape sequence|escape]]'' facilities for including characters that are problematic to include directly. For example: * The characters "<" and "&" are key syntax markers and may never appear in content outside a [[CDATA]] section. It is allowed, but not recommended, to use "<" in XML entity values.{{sfnp|Bray|Paoli|Sperberg-McQueen|Maler|2008|loc=section 2.3}} * Some character encodings support only a subset of Unicode. For example, it is legal to encode an XML document in ASCII, but ASCII lacks code points for Unicode characters such as "é". * It might not be possible to type the character on the author's machine. * Some characters have [[homoglyph|glyphs]] that cannot be visually distinguished from other characters, such as the [[nonbreaking space]] (<code>&#xa0;</code>) " " and the [[Space (punctuation)|space]] (<code>&#x20;</code>) " ", and the [[А|Cyrillic capital letter A]] (<code>&#x410;</code>) "А" and the [[A|Latin capital letter A]] (<code>&#x41;</code>) "A". There are five [[List of XML and HTML character entity references#Predefined entities in XML|predefined entities]]: * <code>&lt;</code> represents "<"; * <code>&gt;</code> represents ">"; * <code>&amp;</code> represents "&"; * <code>&apos;</code> represents "{{mono|'}}"; * <code>&quot;</code> represents '{{mono|"}}'. All permitted Unicode characters may be represented with a ''[[numeric character reference]]''. Consider the Chinese character "中", whose numeric code in Unicode is hexadecimal 4E2D, or decimal 20,013. A user whose keyboard offers no method for entering this character could still insert it in an XML document encoded either as <code>&#20013;</code> or <code>&#x4e2d;</code>. Similarly, the string "I <3 Jörg" could be encoded for inclusion in an XML document as <code>I &lt;3 J&#xF6;rg</code>. <code>&#0;</code> is not permitted because the [[null character]] is one of the control characters excluded from XML, even when using a numeric character reference.<ref>{{cite web|first1=Tex|last1=Texin|first2=François|last2=Yergeau|date=6 September 2003|url=http://www.w3.org/International/questions/qa-controls|title=W3C I18N FAQ: HTML, XHTML, XML and Control Codes|website=W3C Internationalization|publisher=W3C|access-date=16 November 2017}}</ref> An alternative encoding mechanism such as [[Base64]] is needed to represent such characters.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)