XEP-0106: Fix example whitespace

This commit is contained in:
Sam Whited 2016-07-21 08:53:07 -05:00
parent 7cacdba6df
commit 2f0152b259
1 changed files with 46 additions and 46 deletions

View File

@ -142,14 +142,14 @@
</table>
<p>* Note: The character sequence \20 MUST NOT be the first or last character of an escaped localpart. <note>For a similar restriction, see Section 2.4 of <cite>RFC 2253</cite>.</note></p>
<p>In the following example, Porthos starts a chat with D'Artagnan, typing into his client the string "d'artagnan@musketeers.lit" (which is escaped by his client to "d\27artagnan@musketeers.lit").</p>
<example caption="JID Escaping"><![CDATA[
<example caption="JID Escaping"><![CDATA[
<message
from='porthos@musketeers.lit/gate'
to='d\27artagnan@musketeers.lit'
type='chat'>
<body>And do you always forget your eyes when you run?</body>
</message>
]]></example>
]]></example>
</section2>
<section2 topic='Unescaping Transformations' anchor='unescaping'>
<p>The unescaping transformations are defined in the following table, whereas the rules that define when to apply these transformations are specified in the <link url='#bizrules'>Business Rules</link> section of this specification. Typically, unescaping is performed only by a client that wants to display JIDs containing escaped characters to a human user, or by a gateway to some external system (e.g., email or LDAP) that needs to generate identifiers for foreign systems.</p>
@ -167,13 +167,13 @@
<tr><td>\5c</td><td>\</td></tr>
</table>
<p>In the following example, D'Artagnan the elder sends a message through an SMTP mail gateway (the JID is "treville\40musketeers.lit@smtp.gascon.fr" and the destination email address is "treville@musketeers.lit").</p>
<example caption="JID Unescaping"><![CDATA[
<example caption="JID Unescaping"><![CDATA[
<message
from='d\27artagnan@gascon.fr/elder'
to=']]>tr&#xe9;ville\40musketeers.lit@smtp.gascon.fr<![CDATA['>
<body>I recommend my son to you.</body>
</message>
]]></example>
]]></example>
</section2>
</section1>
@ -250,118 +250,118 @@
<p>In general, it is straightforward to transform an email address (i.e., a "dot-atom-text") into a JID, since traditional email addresses allow US-ASCII characters only rather than the nearly full range of Unicode code points allowed in a JID. <note>This specification does not cover recent efforts to define internationalized email addresses.</note> However, there are three characters allowed in the localpart of an email address that are not allowed in the localpart portion of a JID: namely, the characters &amp; ' / as described in Sections 3.2.3 and 3.2.4 of <cite>RFC 5322</cite>. In order to transform these characters, a compliant implementation MUST use the methods specified herein.</p>
<example caption='An Email Address Containing JID-Disallowed Characters'><![CDATA[
here's_a_wild_&_/cr%zy/_address@example.com
]]></example>
]]></example>
<example caption='The Transformed JID'><![CDATA[
here\27s_a_wild_\26_\2fcr%zy\2f_address@example.com
]]></example>
]]></example>
<example caption='The JID as Presented to a User'><![CDATA[
here's_a_wild_&_/cr%zy/_address@example.com
]]></example>
]]></example>
<p>(Note: Because the backslash character is forbidden in the "dot-atom-text" construction, an email address should not contain a character sequence that corresponds to one of the escaped characters specified in the <link url="#transforms">Transformations</link> section of this document; therefore, no such examples are shown.)</p>
<p>An email address may also exist in the form of a mailto: URI as specified in &rfc2368;. Before transforming a mailto: URI into a JID, it MUST be URL-decoded and all headers MUST be removed, leaving a mailbox identifier, as shown in the following example.</p>
<example caption='A mailto: URI Containing JID-Disallowed Characters'><![CDATA[
mailto:here%27s_a_wild_%26_%2Fcr%zy%2F_address@example.com?subject=that%20is%20crazy%21
]]></example>
]]></example>
<example caption='The Resulting Mailbox'><![CDATA[
here's_a_wild_&_/cr%zy/_address@example.com
]]></example>
]]></example>
<example caption='The Transformed JID'><![CDATA[
here\27s_a_wild_\26_\2fcr%zy\2f_address@example.com
]]></example>
]]></example>
<example caption='The JID as Presented to a User'><![CDATA[
here's_a_wild_&_/cr%zy/_address@example.com
]]></example>
]]></example>
<p>The foregoing examples showed how to transform an email address or mailto: URI into a JID. However, it also may be necessary to convert a JID into an email address or mailto: URI, as shown in the following example.</p>
<example caption='User Enters Address, Including Disallowed Characters'><![CDATA[
here's_a_wild_&_/cr%zy/_address@example.com
]]></example>
]]></example>
<example caption='Client Transforms Address Using JID Escaping'><![CDATA[
here\27s_a_wild_\26_\2fcr%zy\2f_address@example.com
]]></example>
]]></example>
<example caption='Application Converts Escaped JID to Mailbox'><![CDATA[
here's_a_wild_&_/cr%zy/_address@example.com
]]></example>
]]></example>
<example caption='Application Converts Mailbox to mailto: URI'><![CDATA[
mailto:here%27s_a_wild_%26_%2Fcr%zy%2F_address@example.com
]]></example>
]]></example>
</section2>
<section2 topic='SIP Addresses' anchor='examples-sip'>
<p>As specified in &rfc3261;, a SIP address (i.e., a sip: or sips: URI) can be quite complex if URI parameters or headers are included. However, a basic SIP address (the combination of the optional "userinfo" and required "hostport" constructions) is essentially similar to an email address (e.g., the same characters &amp; ' / allowed in an email address but disallowed in an XMPP localpart are also allowed in a basic SIP address).</p>
<example caption='A Basic sip: URI Containing JID-Disallowed Characters'><![CDATA[
sip:here%27s_a_wild_%26_%2Fcr%zy%2F_address@example.com
]]></example>
]]></example>
<example caption='The URL-Decoded Address'><![CDATA[
here's_a_wild_&_/cr%zy/_address@example.com
]]></example>
]]></example>
<example caption='The Transformed JID'><![CDATA[
here\27s_a_wild_\26_\2fcr%zy\2f_address@example.com
]]></example>
]]></example>
<example caption='The JID as Presented to a User'><![CDATA[
here's_a_wild_&_/cr%zy/_address@example.com
]]></example>
]]></example>
<p>The foregoing example showed how to transform a sip: or sips: URI into a JID. However, it also may be necessary to convert a JID into a sip: or sips: URI, as shown in the following example.</p>
<example caption='User Enters Address, Including Disallowed Characters'><![CDATA[
here's_a_wild_&_/cr%zy/_address@example.com
]]></example>
]]></example>
<example caption='Client Transforms Address Using JID Escaping'><![CDATA[
here\27s_a_wild_\26_\2fcr%zy\2f_address@example.com
]]></example>
]]></example>
<example caption='Application Converts Escaped JID to sip: URI'><![CDATA[
sip:here%27s_a_wild_%26_%2Fcr%zy%2F_address@example.com
]]></example>
]]></example>
</section2>
<section2 topic='IM and Presence Addresses' anchor='examples-im'>
<p>The im: and pres: URI schemes are specified in &rfc3860; and &rfc3859; respectively. With the exception of headers, an im: or pres: URI is simply a mailbox (as specified in <cite>RFC 5322</cite>) prepended with the im: or pres: scheme. Thus a basic IM or PRES address (not including optional headers) is essentially similar to an email address (e.g., the same characters &amp; ' / allowed in an email address but disallowed in an XMPP localpart are also allowed in a basic IM or PRES address).</p>
<example caption='A Basic im: URI Containing JID-Disallowed Characters'><![CDATA[
im:here%27s_a_wild_%26_%2Fcr%zy%2F_address@example.com
]]></example>
]]></example>
<example caption='The URL-Decoded Address'><![CDATA[
here's_a_wild_&_/cr%zy/_address@example.com
]]></example>
]]></example>
<example caption='The Transformed JID'><![CDATA[
here\27s_a_wild_\26_\2fcr%zy\2f_address@example.com
]]></example>
]]></example>
<example caption='The JID as Presented to a User'><![CDATA[
here's_a_wild_&_/cr%zy/_address@example.com
]]></example>
]]></example>
<p>The foregoing example showed how to transform an im: or pres: URI into a JID. However, it also may be necessary to convert a JID into an im: or pres: URI, as shown in the following example.</p>
<example caption='User Enters Address, Including Disallowed Characters'><![CDATA[
here's_a_wild_&_/cr%zy/_address@example.com
]]></example>
]]></example>
<example caption='Client Transforms Address Using JID Escaping'><![CDATA[
here\27s_a_wild_\26_\2fcr%zy\2f_address@example.com
]]></example>
]]></example>
<example caption='Application Converts Escaped JID to pres: URI'><![CDATA[
pres:here%27s_a_wild_%26_%2Fcr%zy%2F_address@example.com
]]></example>
]]></example>
</section2>
<section2 topic='IMPS Addresses' anchor='examples-imps'>
<p>The Instant Messaging and Presence Service (IMPS) protocol was originally defined by the Wireless Village consortium and is now maintained by the &OMA;. An IMPS address is formatted as a wv: URI, as specified in &wv-csp;. A basic address (not including a private resource) is of the form &lt;wv:user-id@domain&gt; and an address with a private resource is of the form &lt;wv:user-id/resource@domain&gt;.</p>
<p>The "User-ID" construction is either a mobile phone number (beginning with "+1" for international numbers and a digit for national numbers) or an "Internet-Identity". An "Internet-Identity" may contain any US-ASCII character other than / @ + SP TAB and thus may include the following characters that are disallowed in the localpart of a JID: " &amp; ' / : &lt; &gt; (which characters MUST be escaped when transforming an IMPS address into a JID). However, some of those characters are also reserved in URI syntax (namely the &amp; ' / characters) so those characters will be found in escaped form within a wv: URI.</p>
<example caption='A Basic wv: URI Containing JID-Disallowed Characters'><![CDATA[
wv:here%27s_a_wild_%26_%2Fcr%zy%2F_address_for%3A%3Cwv%3E%28%22IMPS%22%29@example.com
]]></example>
]]></example>
<example caption='The URL-Decoded Address'><![CDATA[
here's_a_wild_&_/cr%zy/_address_for:<wv>("IMPS")@example.com
]]></example>
]]></example>
<example caption='The Transformed JID'><![CDATA[
here\27s_a_wild_\26_\2fcr%zy\2f_address_for\3a\3cwv\3e(\22IMPS\22)@example.com
]]></example>
]]></example>
<example caption='The JID as Presented to a User'><![CDATA[
here's_a_wild_&_/cr%zy/_address_for:<wv>("IMPS")@example.com
]]></example>
]]></example>
<p>Unlike the foregoing address types, IMPS addresses are allowed to contain backslashes. This implies that it is possible for an IMPS address to contain a character sequence that corresponds to one of the escaped character representations for code points that are disallowed in XMPP localparts. An example would be the IMPS address &lt;wv:\3and\2is\5cool@example.com&gt;, where the character sequence "\3a" could be interpreted as the : character (and the character sequence "\5c" as "\") if that IMPS address is directly converted into a JID. Therefore, the leading \ character MUST be transformed to "\5c" (and the source character sequence "\5c" to "\5c5c") in order to avoid possible ambiguity. Thus the transformed JID would be &lt;\5c3and\2is\5c5cool@example.com&gt;, which would be presented to a user as &lt;\3and\2is\5cool@example.com&gt;.</p>
<p>If an IMPS address contains a private resource, a gateway between XMPP and IMPS should process the resource and append it to the end of the JID; however, such gateway behavior is out of scope for this document.</p>
<p>The foregoing example showed how to transform a wv: URI into a JID. However, it also may be necessary to convert a JID into a wv: URI, as shown in the following example.</p>
<example caption='User Enters Address, Including Disallowed Characters'><![CDATA[
here's_a_wild_&_/cr%zy/_address_for:<wv>("IMPS")@example.com
]]></example>
]]></example>
<example caption='Client Transforms Address Using JID Escaping'><![CDATA[
here\27s_a_wild_\26_\2fcr%zy\2f_address_for\3a\3cwv\3e(\22IMPS\22)@example.com
]]></example>
]]></example>
<example caption='Application Converts Escaped JID to wv: URI'><![CDATA[
wv:here%27s_a_wild_%26_%2Fcr%zy%2F_address_for%3A%3Cwv%3E%28%22IMPS%22%29@example.com
]]></example>
]]></example>
</section2>
<section2 topic='LDAP Distinguished Names' anchor='examples-ldap'>
<p>Within the Lightweight Directory Access Protocol (see &rfc2251;), a "distinguished name" (DN) is a hierarchically-organized string representation that uniquely identifies a user, system, or organization. It is possible that some messaging systems use LDAP distinguished names to identify entities that can communicate using the system (e.g., this is reputed to be the case for certain releases of the Lotus Sametime system sold by IBM), and in any case it may be helpful to transform an LDAP distinguished name into an XMPP address for identification or addressing purposes.</p>
@ -372,11 +372,11 @@ CN=D'Artagnan Saint-Andr&#xe9;,O=Example &amp; Company, Inc.,DC=example,DC=com
</example>
<example caption='UTF-8 Representation of Distinguished Name'><![CDATA[
CN=D'Artagnan Saint-Andr\E9,O=Example &amp; Company\, Inc.,DC=example,DC=com
]]></example>
]]></example>
<p>This example assumes that the specified user is identified with a gateway running at st.example.com (note that the backslash escaping the , character in the organization name is removed during the transformation).</p>
<example caption='The Transformed JID'><![CDATA[
CN=D\27Artagnan\20Saint-Andr\E9,O=Example\20\26\20Company,\20Inc.,DC=example,DC=com@st.example.com
]]></example>
]]></example>
<example caption='The JID as Presented to a User'>
CN=D'Artagnan Saint-Andr&#xe9;,O=Example &amp; Company, Inc.,DC=example,DC=com@st.example.com
</example>
@ -384,13 +384,13 @@ CN=D'Artagnan Saint-Andr&#xe9;,O=Example &amp; Company, Inc.,DC=example,DC=com@s
<p>The foregoing example showed how to transform an LDAP distinguished name into a JID. However, it also may be necessary to convert a JID into an LDAP distinguished name, as shown in the following example.</p>
<example caption='User Enters Address, Including Disallowed Characters'><![CDATA[
CN=D'Artagnan Saint-Andr&#xe9;,O=Example &amp; Company, Inc.,DC=example,DC=com@st.example.com
]]></example>
]]></example>
<example caption='Client Transforms Address Using JID Escaping'><![CDATA[
CN=D\27Artagnan\20Saint-Andr\E9,O=Example\20\26\20Company,\20Inc.,DC=example,DC=com@st.example.com
]]></example>
]]></example>
<example caption='Application Converts Escaped JID to UTF-8 Representation of LDAP Distinguished Name'><![CDATA[
CN=D'Artagnan Saint-Andr\E9,O=Example &amp; Company\, Inc.,DC=example,DC=com
]]></example>
]]></example>
<example caption='Application Converts UTF-8 Representation to LDAP Distinguished Name'>
CN=D'Artagnan Saint-Andr&#xe9;,O=Example &amp; Company, Inc.,DC=example,DC=com
</example>
@ -399,13 +399,13 @@ CN=D'Artagnan Saint-Andr&#xe9;,O=Example &amp; Company, Inc.,DC=example,DC=com
<p>&rfc2812; defines the address format for Internet Relay Chat (IRC) entities, which can be servers, channels, or users. The "user" portion of an IRC address may contain any octet except NUL, CR, LF, SP, and "@"; this includes the characters " &amp; ' / : &lt; &gt; \ (which are disallowed in XMPP localparts and therefore MUST be escaped when transforming an IRC address into a JID).</p>
<example caption='A Basic IRC address Containing JID-Disallowed Characters'><![CDATA[
somenick!user"&'/:<>\3address@example.com
]]></example>
]]></example>
<example caption='The Transformed JID'><![CDATA[
somenick!user\22\26\27\2f\3a\3c\3e\5c3address@example.com
]]></example>
]]></example>
<example caption='The JID as Presented to a User'><![CDATA[
somenick!user"&'/:<>\3address@example.com
]]></example>
]]></example>
<p>Like IMPS addresses, IRC addresses are allowed to contain backslashes. This implies that it is possible for an IMPS address to contain a character sequence that corresponds to one of the escaped character representations for code points that are disallowed in XMPP localparts. An example is shown above.</p>
</section2>
</section1>
@ -419,7 +419,7 @@ somenick!user"&'/:<>\3address@example.com
id='info1'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
]]></example>
]]></example>
<p>If the queried entity supports JID escaping, it MUST return a <strong>jid\20escaping</strong> [sic] feature in its reply.</p>
<example caption='Service responds with features'><![CDATA[
<iq type='get'
@ -431,7 +431,7 @@ somenick!user"&'/:<>\3address@example.com
<feature var='jid\20escaping'/>
</query>
</iq>
]]></example>
]]></example>
</section1>
<section1 topic='Security Considerations' anchor='security'>