Skip to content
Browse files

Initial revision

  • Loading branch information...
wrygiel committed Oct 26, 2016
0 parents commit cf9b101270185d5986692c1a1295b6e57ef8eff9
Showing with 173 additions and 0 deletions.
  1. +81 −0
  2. +92 −0 schema.xsd
@@ -0,0 +1,81 @@
EWP Phone Number Types

* [What is the status of this document?][statuses]
* [See the index of all other EWP Specifications][develhub]


This repository contains XML Schemas used in EWP APIs for encoding phone and
fax numbers. It follows the same [versioning rules][compat-rules] as all EWP
APIs do. Other projects are welcome to reuse this schema, along with its
namespace. We are also open to suggestions of extending it.

About this data type

### About E.164 standard

As opposed to [addresses][specs-address], phone number formats were much
easier to decide upon, because there already exists an international standard
for handling those.

You can read more on this standard:

* [on our issue pages][discussion],
* [on Twilio's support pages][twilio-article],
* [on Wikipedia](

### Compatibility and conversions

There are free libraries, such as Google's [libphonenumber]
(, which allow you to convert
between national phone numbers and E.164. This means that clients will be able
to "pretty print" such number, and server should also be able to easily provide
them in E.164 format.

However, if - for some reason - the server is not able to convert its data to
E.164 format, we allow it to be provided in unformatted way too (with the
`<other-format>` element).

The Schema

See attached [`schema.xsd`](schema.xsd) file.




<!-- To be avoided. -->
<other-format>(23) 456789</other-format>

@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- WRTODO: Replace all occurrences of 'master' (in all projects) with 'stable-v1' upon release. -->

/> <!-- WRTODO: absolute paths! -->

This schema is a part of the Erasmus Without Paper project. Before you start
using it, make sure you have read the general rules described here:

<xs:complexType name="PhoneNumber">
A phone number. Whenever possible, this SHOULD be provided in E.164 format
(with the leading "+" sign).

More information and reasoning here:
<xs:element name='e164' minOccurs="0" maxOccurs="1">
Phone number in the E.164 format, with the leading "+" sign.

This MUST be a "plain" E.164 string, without any extensions. Extensions are
transferred in the `ext` element instead.
<xs:restriction base="xs:string">
<xs:pattern value="\+[0-9]{1,15}"></xs:pattern>
<xs:element name='ext' minOccurs="0" maxOccurs="1">
Extension number.
<xs:element name='other-format' minOccurs="0" maxOccurs="1" type="xs:string">
If, for some reason, you are unable to provide a valid phone number with the
`e164` and `ext` elements, then you can provide it in any other format here.
Server developers MAY also provide both - E.164 along with the original
other-format - which might be useful for debugging on-the-fly conversion.

Client developers MAY ignore `other-format` numbers. Server developers SHOULD
use `other-format` only as a last resort.

<xs:element name="phone-number" type="PhoneNumber">
A phone number.

<xs:element name="fax-number" type="PhoneNumber">
A fax number.


0 comments on commit cf9b101

Please sign in to comment.
You can’t perform that action at this time.