Skip to content

Commit

Permalink
XEP-0060: Add integer-or-max datatype to use with Data Forms Validation
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
  • Loading branch information
Ppjet6 committed Sep 25, 2020
1 parent c7166ab commit 1051b5e
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions xep-0060.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
&pgmillard;
&stpeter;
&ralphm;
<revision>
<version>1.20.0</version>
<date>2020-09-24</date>
<initials>pep</initials>
<remark><p>Add integer-or-max datatype to use with Data Forms Validation.</p></remark>
</revision>
<revision>
<version>1.19.0</version>
<date>2020-08-16</date>
Expand Down Expand Up @@ -5905,6 +5911,29 @@ xmpp:pubsub.shakespeare.lit?pubsub;action=subscribe;node=princely_musings
xmpp:pubsub.shakespeare.lit?pubsub;action=retrieve;node=princely_musings;item=ae890ac52d0df67ed7cfdf51b644e901
]]></example>
</section2>

<section2 topic='Integration with Data Forms' anchor='usecase.xdata'>
<p>This section defines a datatype "integer-or-max" to be used with &xep0122;. An implementation may use this type to validate fields such as "pubsub#children_max", "pubsub#item_expire" or "pubsub#max_items".</p>
<code><![CDATA[
<schema xmlns='http://www.w3.org/2001/XMLSchema'>
<simpleType>
<union>
<simpleType>
<restriction base='integer'/>
</simpleType>
<simpleType>
<restriction base='string'>
<enumeration value='max'/>
</restriction>
</simpleType>
</union>
</simpleType>
</schema>
]]></code>
<p>The meaning of a value of this type is defined in each field named above.</p>
<p>When the <link url='xep-0122.html#usecases-validation.range'>&lt;range/&gt; element</link> is used in combination with this datatype, it applies to the integer value.</p>
</section2>

</section1>

<section1 topic='Internationalization Considerations' anchor='i18n'>
Expand Down Expand Up @@ -6652,6 +6681,20 @@ xmpp:pubsub.shakespeare.lit?pubsub;action=retrieve;node=princely_musings
</key>
</keys>
</querytype>
]]></code>
</section2>

<section2 topic='Data Forms Validation Datatypes' anchor='registrar.xdata-validate'>
<p>The following datatype shall be registered for use with Data Forms Validation:</p>
<code caption='Data Forms Validation Datatypes Registry Submission'><![CDATA[
<datatype>
<name>integer-or-max</name>
<desc>
Datatype used for text-single fields where the accepted value is
either an integer or the string "max".
</desc>
<doc>XEP-0060</doc>
</datatype>
]]></code>
</section2>
</section1>
Expand Down

0 comments on commit 1051b5e

Please sign in to comment.