Вы находитесь на странице: 1из 59

CASAMUNDO API Documentation

Release 1.2.1

CASAMUNDO GmbH, Drehbahn 7, 20354 Hamburg

August 20, 2013

CONTENTS

1 2

Changelog Introduction 2.1 About . . . . . . . . 2.2 Access . . . . . . . 2.3 Versions . . . . . . 2.4 Files . . . . . . . . 2.5 HTTP . . . . . . . . 2.6 XML Requirements 2.7 Synchronisation . . Settings 3.1 About . . . . 3.2 XML . . . . 3.3 Provider . . 3.4 API . . . . . 3.5 Locales . . . 3.6 Facility . . . 3.7 Lodging . . . 3.8 Availabilities Facilities 4.1 About . . . . 4.2 XML . . . . 4.3 Facility . . . 4.4 Geo data . . 4.5 Descriptions 4.6 Images . . . 4.7 Lodgings . . 4.8 Units . . . . Lodgings 5.1 About . . . . 5.2 XML . . . . 5.3 Lodging . . . 5.4 Capacity . . 5.5 Features . . . 5.6 Descriptions

1 5 5 5 5 6 6 6 7 9 9 9 9 10 10 11 11 11 13 13 13 14 14 15 15 16 16 19 19 19 20 20 21 21

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

5.7 6

Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 23 23 23 24 24

Weekly Availabilities 6.1 About . . . . . 6.2 XML . . . . . 6.3 Availability . . 6.4 Price . . . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

Daily Availabilities 25 7.1 About . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 7.2 XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 7.3 Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Daily Prices 8.1 About . 8.2 XML . 8.3 Period . 8.4 Price . 29 29 29 30 30 31 31 31 33 33 34 36

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

Extras / Discounts 9.1 About . . . . 9.2 XML . . . . 9.3 Extra . . . . 9.4 Restrictions . 9.5 Price . . . . 9.6 Descriptions

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

10 Seasons 37 10.1 About . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 10.2 XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 11 XML Schema (XSD) 11.1 Settings . . . . . . . 11.2 Facilities . . . . . . 11.3 Lodgings . . . . . . 11.4 Weekly Availabilities 11.5 Daily Availabilities . 11.6 Daily Prices . . . . 11.7 Extras . . . . . . . . 11.8 Seasons . . . . . . . 39 39 42 46 46 47 49 50 54

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

ii

CHAPTER

ONE

CHANGELOG
1.2.1 Extras: price attribute calculation_level added 1.2.0 Extras: type DISCOUNT added Extras: boolean date attribute xed replaced by enum attribute coverage Extras: anticipation_days restriction element added for last minute / early bird 1.1.0 Note: version 0.10.4 is stable and considered 1.0.0, therefore 1.0.0 is skipped Weekly Availabilities: individual changeover added 0.10.4 Introduction: HTTP header recommendations added 0.10.3 Facilities: example for encoded image URL added in XML Facilities: area and zip made optional Lodgings: name made optional Lodgings: new lodging types added: boat, castle, mobile home Lodgings: persons restricted (1 64) Lodgings: rooms restricted (positive byte, not 0), made optional Lodgings: oor restricted (-1 28) Lodgings: new criteria featured: detached house, no pets, smoker Images: priority xed in XML schema (1 255) Images: clarify URL encoding in docs Daily Prices: persons restricted (1 64), considered max Weekly Availabilities: persons min/max restricted (1 64) Weekly Availabilities: clarify date range usage in docs Extras: min total made optional, dont deliver if calculatable 1

CASAMUNDO API Documentation, Release 1.2.1

Extras: amount now considerable as total price relative Extras: XML examples made more consistent Extras: persons min/max restricted (1 64) Extras: days min/max restricted (1 255), 28 max preferred Extras: age restricted (0 99) all: string (xs:token) lengths limited according to required state 0.10.2 Weekly Availabilities: XML schema and examples xed Extras: interval STAY deprecated, NONE introduced instead 0.10.1 XML Schema added for all XML les Facilities: distance types added Lodgings: lodging types dened Extras: optional date restriction added attributes orderd in example XML documentation improved 0.10.0 Prices, Extras, Weekly Availabilities: currency added to lenames Currencies: allow multiple currencies per language Appendix: Language and currency codes added, default currencies listed 0.9.0 Versioning: changed and described within Introduction Changelog: added Introduction: About and Accessing the documentation written out Seasons: seasons.xml introduced, from_date and to_date added, season types removed Facilities: lodgings, units claried, seasons made relation Lodgings: feature types in example XML adapted to Appendix list 0.85 Appendix: list of feature keys added Facilities: lodgings listed in facilities.xml must occur only once Internals: rst notes for Casamundo developers (not in PDF) Extras: age made own element, max age added Settings: availability renamed to availabilties in lodging element (1:n) 0.82

Chapter 1. Changelog

CASAMUNDO API Documentation, Release 1.2.1

a lot of changes and initial notes rst version to be handed out

CASAMUNDO API Documentation, Release 1.2.1

Chapter 1. Changelog

CHAPTER

TWO

INTRODUCTION
2.1 About
This documentation describes how to provide vacation lodgings and its related data for CASAMUNDO and its various platforms. The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL in this document are to be interpreted as described in RFC 2119 (http://tools.ietf.org/html/rfc2119).

2.2 Access
The documentation is available as PDF and ZIP. While the PDF is easy to distribute and access, the ZIP has each chapter as a restructuredText (rst) le, all XML examples as separate les, and separate XSD (XML schema) les for XML validation.

2.3 Versions
The CASAMUNDO API is under ongoing development. This document refers version 1.2.1. The versioning follows the scheme [major].[minor].[patch]. A patch only xes typos, claries things or improves structure and format of the documentation itself. Please use always the latest patch release of the API version you are working with. A minor version change extends the existing API by new features without breaking compatibility. That might be new XML elements, attributes or whole XML les, and using them will always be optional. A major version change introduces structural changes or new requirements that do break compatibility. In most cases that means you will have to modify the data export in order to adapt it to a new major version.

CASAMUNDO API Documentation, Release 1.2.1

Note: As from version 0.10.1, existing implementations are supported in longterms.

2.4 Files
The data are to provided in XML les, usually provided via HTTP. Based on an URL like http://api.example.com/, the settings.xml should be provided within the root directory. The other les must be placed within separate language folders, e. g.
|-| | | | | |-| | | | | | | | |-|-de |-- availabilities_daily_eur.xml |-- extras_eur.xml |-- facilities.xml |-- lodgings.xml |-- prices_daily_eur.xml en |-- availabilities_daily_eur.xml |-- availabilities_daily_gbp.xml |-- extras_eur.xml |-- extras_gbp.xml |-- facilities.xml |-- lodgings.xml |-- prices_daily_eur.xml |-- prices_daily_gbp.xml seasons.xml settings.xml

Example above: data in German (EUR) and English (EUR, GBP), availabilities on a daily base.

2.5 HTTP
To enable client-side caching, headers should contain Last-Modified and Content-Length:
HTTP/1.1 200 OK Last-Modified: Thu, 25 Apr 2013 06:52:17 GMT Content-Length: 286450

The usage of HTTP authentication is encouraged.

2.6 XML Requirements


The XML must match the following requirements: charset encoding: UTF-8 line endings: can be either UNIX or DOS, must be consistent format: validated with tidy (indention: 2 spaces, no tabs) content:

Chapter 2. Introduction

CASAMUNDO API Documentation, Release 1.2.1

validated against XML schema les, e. g. with xmllint only data for lodgings that are actually bookable HTML elements (where allowed) must be wrapped into <![CDATA[...]]> Invalid XML is not supported.

2.7 Synchronisation
The imports at CASAMUNDO are done via cronjobs, each requesting data of one provider in one language and currency. Full imports cover all data delivered and are run every couple of nights (CET). Availability imports update availabilities, prices and extras. Facilities and lodgings are kept as imported with the lates full import. Availability imports are usually run every night (CET).

2.7. Synchronisation

CASAMUNDO API Documentation, Release 1.2.1

Chapter 2. Introduction

CHAPTER

THREE

SETTINGS
3.1 About
The settings.xml delivers meta information on: how the provided data are structured, what default values are used, and which API version the offer is refering to.

3.2 XML
A typical settings.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?> <settings> <provider name="John Doe Travel Company"/> <api> <version>1.2</version> </api> <locales> <locale language="DE" currency="EUR"/> <locale language="EN" currency="EUR"/> <locale language="EN" currency="GBP"/> </locales> <facility> <lodgings>MULTIPLE</lodgings> </facility> <lodging seasons="true"> <availabilities type="DAILY" changeover="MAP"/> </lodging> </settings>

3.3 Provider
The <provider name> attribute (string) contains the name of the company providing the data.

CASAMUNDO API Documentation, Release 1.2.1

3.4 API
The <version> (string) describes the version of the CASAMUNDO API reference implemented by the provider. This document refers to version 1.2.1. See Introduction Versions for details on how versions are referenced. Note: The API version declared in settings.xml covers all XML les provided at a time.

3.5 Locales
The <locales> dene languages and currencies that are delivered. The following language codes are supported: Code CZ DE EN ES FR HU IT NL PL SK Language Czech German English Spanish French Hungarian Italian Dutch Polish Slovakian

The currency codes must be ISO 4217 (http://en.wikipedia.org/wiki/ISO_4217) conform, e. g.: Code CZK EUR GBP PLN Currency Czech koruna Euro Pound sterling Polish zloty

The currencies declared in settings.xml must be referenced in some XML le names (lowercase): [language]/availabilities_daily_[currency].xml [language]/availabilities_weekly_[currency].xml [language]/extras_[currency].xml [language]/prices_daily_[currency].xml The preferred currencies per language are:

10

Chapter 3. Settings

CASAMUNDO API Documentation, Release 1.2.1

Language CZ DE EN ES FR HU IT NL PL SK

Prefered currency CZK EUR both EUR and GBP EUR EUR EUR EUR EUR PLN EUR

3.6 Facility
A <facility> can have have "MULTIPLE" lodgings or always equals a "SINGLE" one.

3.7 Lodging
The season attribute (boolean) must be "true" when one lodging (then called unit) is delivered multiple times, each for a different season.

3.8 Availabilities
There are two <availabilities type> options: delivered "DAILY", with changeover dened individually as "MAP", or delivered "WEEKLY", with default changeover one of "MON", "TUE", "WED", "THU", "FRI", "SAT" or "SUN".

3.6. Facility

11

CASAMUNDO API Documentation, Release 1.2.1

12

Chapter 3. Settings

CHAPTER

FOUR

FACILITIES
4.1 About
Facilities are buildings of any kind that usually cant be booked at whole. They contain bookable lodgings. There may be multiple lodgings within a facility.

4.2 XML
A typical facilities.xml has one <facilities> element that contains all facilities offered.
<?xml version="1.0" encoding="UTF-8"?> <facilities> <facility id="89" name="Villa del Sol"> <geodata> <location> <country>ITALY</country> <region>Amalfi Coast</region> <area>Sorrento Coast</area> <zip>80061</zip> <place>Massa Lubrense</place> </location> <position> <latitude>40.616667</latitude> <longitude>14.35</longitude> </position> <distances> <distance type="CITY">10000</distance> <distance type="WATER">250</distance> </distances> <nearby> <airport>Salerno Costa dAmalfi Airport</airport> <beach>Santa Croce</beach> </nearby> </geodata> <descriptions> <description type="FACILITY"> An impressive, luxury villa situated in one of the most beloved areas and yet off to the landscape. </description> <description type="SURROUND"> Trees, mountains and a beach.

13

CASAMUNDO API Documentation, Release 1.2.1

</description> <description type="OTHER"> Children welcome! Playground, garden and pool. Babysitter on request. </description> </descriptions> <images> <image priority="1" time_of_year="SUMMER" type="SURROUND"> <url>http://example.com/images/47359_%5B1%5D.jpg?rev=5</url> <title> The beautiful Villa del Sol surrounded by wonderful mountains. </title> </image> <image priority="2" time_of_year="SUMMER"> <url>http://example.com/images/47359b.jpg</url> <title> The beautiful Villa del Sol surrounded by wonderful mountains. </title> </image> </images> <lodgings> <unit id="152"> <lodging season_id="2012" id="152A"></lodging> <lodging season_id="2013" id="152N"></lodging> </unit> <unit id="47"> <lodging season_id="2012" id="47A"></lodging> <lodging season_id="2013" id="47N"></lodging> </unit> <unit id="734"> <lodging season_id="2012" id="734A"></lodging> <lodging season_id="2013" id="734N"></lodging> </unit> </lodgings> </facility> </facilities>

4.3 Facility
The <facility id> (([a-zA-Z0-9.-])+) must be unique. The facility name (string) is mandatory.

4.4 Geo data


4.4.1 Location
The <location> element is mandatory and must contain a <country>, a <region> and a <place> with non-empty strings. The elements <area> and <zip> are optional. All location names must be delivered in a consistent manner.

14

Chapter 4. Facilities

CASAMUNDO API Documentation, Release 1.2.1

4.4.2 Position
The <position> should be fully delivered, but may be delivered as emtpy element. Both <latitude> and <longitude> (decimal) must be dened in WGS 84: latitude: "-90.0" "90.0", and longitude: "-180.0" "180.0".

4.4.3 Distances
The <distances> element may be delivered emtpy, or it must contain <distance> elements given in meter and covering some or all types: Type AIRPORT CITY FISHING RESTAURANT SHOPPING SKIING WATER Description of airport nearest town shing possibilities restaurant, bar shopping facilities skiing facilities water (sea, lake)

4.4.4 Nearby
The <airport> and <beach> elements (both string) name the closest airport or beach. Both may be omitted.

4.5 Descriptions
The <descriptions> element is required, but it may be empty. It contains <description> elements with text and a type of: Type FACILITY SURROUND VIEW DISTANCES OTHER Description of the facility in general, without lodging specic details infrastructure and attractions within the area visual impressions one cat get from the facility distances to relevant points not listed in <distances> anything else that might be relevant (facility level only!).

Descriptions delivered with facilities must not be duplicated within its lodgings. HTML elements allowed: <ul>, <li>, <br>, <b>, <strong>, <i>, <em>, <p>, <div>, all without style, if descriptions are wrapped in <![CDATA[...]]> sections.

4.6 Images
Images of the following formats are accepted: jpg/jpeg, png, gif.

4.5. Descriptions

15

CASAMUNDO API Documentation, Release 1.2.1

The image <url> must be encoded according to RFC 1738 (http://www.faqs.org/rfcs/rfc1738.html), thus characters like [ or ] must be replaced by %5B respectively %5D. It is recommended to replace + signs by %2B as well, even through not required by RFC 1738 (http://www.faqs.org/rfcs/rfc1738.html). The time_of_year can be "WINTER" or "SUMMER". A priority ("1" "255") should be used to sort images, starting by "1" for the rst image to be displayed. The image type (enumeration) can be one of: INDOOR OUTDOOR SURROUND VIEW GROUNDPLAN SKIPLAN inside the building around the building (default non-indoor) sights and activities in the area landscapes a ground plan a ski plan

Images delivered with facilties must not be duplicated within lodgings.

4.7 Lodgings
The <lodgings> element contains all <lodging> references of a facility with their id.
<lodgings> <lodging id="152"></lodging> <lodging id="47"></lodging> <lodging id="734"></lodging> </lodgings>

Each lodging id (([a-zA-Z0-9.-])+) must be unique throughout all lodgings of all facilities.

4.8 Units
Some providers deliver the same lodging multiple times, once for a season such as a year or summer and wintertime. If at least some lodgings of a provider are duplicated by seasons (see settings.xml), all facilities <lodgings> must be grouped into units: A <unit> is an abstract lodging which describes the actual room, apartment or studio but does not take seasons into account yet. Its <lodging> elements refer to the Seasons via the season_id. Here is an example of how units and lodgings with seasons are listed:
<lodgings> <unit id="152"> <lodging season_id="2012" <lodging season_id="2013" </unit> <unit id="47"> <lodging season_id="2012" <lodging season_id="2013" </unit> <unit id="734">

id="152A"></lodging> id="152N"></lodging>

id="47A"></lodging> id="47N"></lodging>

16

Chapter 4. Facilities

CASAMUNDO API Documentation, Release 1.2.1

<lodging season_id="2012" id="734A"></lodging> <lodging season_id="2013" id="734N"></lodging> </unit> </lodgings>

The unit id (([a-zA-Z0-9.-])+) must be unique within one facility.

4.8. Units

17

CASAMUNDO API Documentation, Release 1.2.1

18

Chapter 4. Facilities

CHAPTER

FIVE

LODGINGS
5.1 About
Lodgings are bookable objects. A lodging always belongs to one facility.

5.2 XML
A typical lodgings.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?> <lodgings> <lodging id="152A" facility_id="89" name="Apartment A" type="APARTMENT" stars="4" floor="1"> <capacity> <size>105</size> <persons min="2" max_with_children="8">6</persons> <rooms sleeping="2" bath="2" other="2">6</rooms> <cots>2</cots> </capacity> <features> <feature type="GARAGE"></feature> <feature type="AIRCON"></feature> <feature type="TELEV"></feature> <feature type="MICROW"></feature> <feature type="DISHW"></feature> </features> <descriptions> <description type="LODGING"> First floor, first class. Lodging with terrace, kitchen, two bathrooms and camin. </description> </descriptions> <images> <image priority="1" time_of_year="SUMMER" type="INDOOR"> <url>http://example.com/images/47360.jpg</url> <title>The living room with wooden terrace.</title> </image> <image priority="2" time_of_year="SUMMER" type="OUTDOOR"> <url>http://example.com/images/47361.jpg</url> <title>The beautiful garden, with sunflowers.</title> </image> </images>

19

CASAMUNDO API Documentation, Release 1.2.1

</lodging> </lodgings>

5.3 Lodging
The id (([a-zA-Z0-9.-])+) is mandatory must be unique over all lodgings of one provider. A lodging may have the same id as its facility. Delivering a name (string) is recommended. The lodging type (enumeration) must be one of: Type APARTMENT BOAT CASTLE FARMHOUSE HOLIDPARK HOTEL HOUSE MOBILEHOME VILLA Meaning apartment, holiday at boat castle farm house, farm holidays holiday park hotel holiday house, vacation home mobile home villa, country residence

Optional attributes are stars ("1" "5") and floor ("-1" "28").

5.4 Capacity
5.4.1 Size
The <size> (unsigned short, in m) is optional, but preferably should be provided.

5.4.2 Persons
The <persons> element ("1" "64") gives the maximum amount of grown-up persons that generally can book a lodging. Periods with fewer persons are allowed. The maximum amount of persons including children must be given via the max_with_children attribute ("1" "64"). The value can be the same as the <persons> element itself, but must not be lower. The min amount of persons ("1" "64") must always be delivered. It may equal the maximum amount, but may not be higher.

5.4.3 Rooms
The <rooms> element (positive byte) gives the total amount of rooms a lodging has. It may be left out if the amount of rooms is unknown, but should be delivered. Rooms can be specied by the attributes sleeping, bath and other (all unsigned byte, including 0). If all three are delivered, they must sum up to the total amount of rooms. 20 Chapter 5. Lodgings

CASAMUNDO API Documentation, Release 1.2.1

5.4.4 Cots
The amount of <cots> (unsigned byte) is optional, but should be provided if possible.

5.5 Features
The <features> element is required, but it may be empty. It contains a set of <feature> declarations, each naming a type (enumeration) of: Type AIRCON BARBEC BOAT DETACHD DISHW FIREPL FISHING GARAGE GOLF GROUND HANDACC INTERN MICROW NPETS NSMOKE PETS SAUNA SKIING SMOKE SOLAR SWPOOL TELEV TENNIS TERRACE WASHM WATER Feature aircondition barbecue boat detached (free-standing) house dishwasher replace shing garage golf private ground handicapped accessible internet microwave no pets non smoker pets sauna skiing smoker solarium swimming pool television tennis terrace washing machine water (sea, lake)

5.6 Descriptions
The <descriptions> element is required, but it may be empty. <description> (string) elements of a type (enumeration): It contains a set of

5.5. Features

21

CASAMUNDO API Documentation, Release 1.2.1

Type LODGING VIEW COSTS EXTRA INCLUSIVE DEPOSIT DISCOUNT BOOKING OTHER

Description of Lodging specic details without repeating general facility info. Visual impressions one cat get from the lodging. General info on extra or inclusive costs. Costs that are non-obligatory and non-inclusive. Costs that are already included in the base price. A deposit note (with currency), may contain details. Discounts that are offered and their conditions. Booking relevant information. Anything else that might be relevant.

HTML elements allowed: <ul>, <li>, <br>, <b>, <strong>, <i>, <em>, <p>, <div>, all without style, if descriptions are wrapped in <![CDATA[...]]> sections. Descriptions already delivered with a facility must not be repeated within its lodging.

5.7 Images
The <images> element within a <lodging> has the same structure as the one used in Facilities. Images already delivered with a facility must not be repeated within its lodging.

22

Chapter 5. Lodgings

CHAPTER

SIX

WEEKLY AVAILABILITIES
6.1 About
Weekly Availabilities dene vacancies and prices for lodgings on a weekly base. For daily availabilities to be imported, <availabilities type="WEEKLY"> must be declared within the Settings.

6.2 XML
A typical availabilties_weekly_[currency].xml looks like this:
<?xml version="1.0" encoding="UTF-8"?> <availabilities> <lodging id="152A"> <availability type="VACANT" from_date="2012-02-11" to_date="2012-03-27"> <price persons_min="2" persons_max="2">840</price> <price persons_min="3" persons_max="4">1050</price> <price persons_min="5" persons_max="6">1260</price> </availability> <availability type="VACANT" from_date="2012-04-08" to_date="2012-04-15"> <price persons_min="4" persons_max="4">1400</price> <price persons_min="5" persons_max="5">1540</price> <price persons_min="6" persons_max="6">1680</price> </availability> </lodging> <lodging id="47A" changeover="SUN"> <availability type="REQUEST" from_date="2012-02-01" to_date="2012-04-15"> <price persons_min="2" persons_max="2">1330</price> <price persons_min="3" persons_max="4">1540</price> </availability> <availability type="VACANT" from_date="2012-04-16" to_date="2012-04-30"> <price persons_min="2" persons_max="2">1540</price> <price persons_min="3" persons_max="4">1750</price> </availability> </lodging> </availabilities>

23

CASAMUNDO API Documentation, Release 1.2.1

6.3 Availability
Each <lodging> element can have multiple <availability> declarations. Optionally, its changover attribute may overwrite the general changeover dened within the Settings. The date range dened with from_date and to_date (date) must not intersect with other <availability> date ranges of the same lodging. The to_date is considered as the last possible day of a week-based stay including the night, thus departure will usually be on the day after. Date ranges delivered must cover at least one week (considering the changeover day). They dont need to represent single weeks and should cover date ranges as long as possible. Both from_date and to_date do not need to be actual changeover days. The type (enumeration) must be either "VACANT" or "REQUEST".

6.4 Price
Each <availability> must have at least one <price> (decimal). The currency is the one given with the lename. The persons_min and persons_max attributes ("1" "64") are mandatory and dene the person range the price is valid for. Prices are always understood as total price per week, not by one person. Extras / Discounts must be dened separately.

24

Chapter 6. Weekly Availabilities

CHAPTER

SEVEN

DAILY AVAILABILITIES
7.1 About
Daily availabilities contain vacancy, changeover and minstay information for a lodging. For daily availabilities to be imported, <availabilities type="DAILY"> must be declared within the Settings.

7.2 XML
A typical availabilties_daily.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?> <availabilities type="DAILY"> <availability lodging_id="152A"> <from_date>2012-02-21</from_date> <vacancy type="PER_DAY"> 000000000000000000000000000000000000000000000000000000000000111111111111111 111111111111111111111111110000000000011111111111111111111111111111111111111 110000000000000000111001111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111000000000000001111111111111111111111111 10000000000000 </vacancy> <changeover type="ALL_DAYS">1</changeover> <minstay type="ALL_DAYS">A</minstay> </availability> <availability lodging_id="152N"> <from_date>2013-01-01</from_date> <vacancy type="PER_DAY"> 000000001111111111111111111111111111111111100000000111111111111111111111000 111111111111111111111111110011111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111111111111111111111111111111111111111111111111 </vacancy> <changeover type="ALL_DAYS">1</changeover> <minstay type="ALL_DAYS">A</minstay> </availability> <availability lodging_id="47A"> <from_date>2012-02-21</from_date> <vacancy type="ALL_DAYS">2</vacancy> <changeover type="ALL_DAYS">1</changeover>

25

CASAMUNDO API Documentation, Release 1.2.1

<minstay type="ALL_DAYS">A</minstay> </availability> <availability lodging_id="47N"> <from_date>2013-01-01</from_date> <vacancy type="ALL_DAYS">2</vacancy> <changeover type="ALL_DAYS">1</changeover> <minstay type="ALL_DAYS">A</minstay> </availability> <availability lodging_id="734A"> <from_date>2012-02-21</from_date> <vacancy type="PER_DAY"> 000000000000000000000000000000000000000000000000111000000011111110000000000 000000000000000000000001111111110000000000000000000000000000000000000000000 000000000111111111111111111111111111111111111111111111111111111111111111100 000000011111111111111111111111111111111111111111111111000000000000000000011 10000000000000 </vacancy> <changeover type="PER_DAY"> 111111111111111111111111111111111111111111111111111111111111111111111111111 111111110000001000000100000010000001000000100000010000001000000100000010000 001000000100000010000001000000100000010000001000000100000010000001111111111 111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111 </changeover> <minstay type="PER_DAY"> AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAA </minstay> </availability> <availability lodging_id="734N"> <from_date>2013-01-01</from_date> <vacancy type="PER_DAY"> 000000001111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111111111111111111111111111111111111111111111111 </vacancy> <changeover type="PER_DAY"> 1111111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111111111111111111111111111111111111111110000001000000100000 0100000010000001000000100000010000001000000100000010000001000000100000010000 0010000001000000100000010000001000000111111111111111111111111111111111111111 1111111111111111111111111111111111111111111111111111111111111111 </changeover> <minstay type="PER_DAY"> AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA </minstay> </availability> </availabilities>

26

Chapter 7. Daily Availabilities

CASAMUNDO API Documentation, Release 1.2.1

7.3 Availability
Each lodging may have only one availability entry, so the lodging_id (see Lodgings) must be unique over all daily availabilities . The <vacancy>, <changeover> and <minstay> elements contain maps that represent status information by day, starting with <from_date>. If one of those maps would be the same character repeated by every day, those must be grouped to one character using the type="ALL_DAYS" with only one character. Otherwise its type="PER_DAY". The map length (amount of days) must be equal for all three maps.

7.3.1 Vacancy
The <vacancy> map consists of chars describing how days are available. char 0 1 2 vacancy not available available on request only

7.3.2 Changeover
The <changeover> map consists of chars describing which days are valid for arrival and departure. char 0 1 2 3 change no change at all arrival and departure arrival only departure only

7.3.3 Minstay
The <minstay> map consists of chars describing how many days must be booked at least, depending on the day the residence begins. char A B C . . Z days 1 2 3 . . 26

7.3. Availability

27

CASAMUNDO API Documentation, Release 1.2.1

28

Chapter 7. Daily Availabilities

CHAPTER

EIGHT

DAILY PRICES
8.1 About
Daily prices are delivered for lodgings booked with Daily Availabilities. This chapter is about daily prices only. Prices for weekly booked lodgings are embedded into Weekly Availabilities. For daily prices to be imported, <availabilities type="DAILY"> must be declared within the Settings.

8.2 XML
A typical prices_daily_[currency].xml looks like this:
<?xml version="1.0" encoding="UTF-8"?> <prices> <lodging id="152A"> <period date_from="2012-02-01" date_to="2012-03-31"> <price persons="2">120</price> <price persons="4">150</price> <price persons="6">180</price> </period> <period date_from="2012-04-01" date_to="2012-04-15"> <price persons="4">200</price> <price persons="5">220</price> <price persons="6">240</price> </period> </lodging> <lodging id="47A"> <period date_from="2012-02-01" date_to="2012-04-15"> <price persons="2">190</price> <price persons="4">220</price> </period> <period date_from="2012-04-16" date_to="2012-04-30"> <price persons="2">220</price> <price persons="4">250</price> </period> </lodging> </prices>

29

CASAMUNDO API Documentation, Release 1.2.1

8.3 Period
Each lodging may have multiple periods with prices that can be dened for multiple persons. A <period> is described by date_from and a (never earlier) date_to (date). The date range must be distinct from all other periods of the same lodging. Periods should be sorted towards the future, and should not have the same prices as precedent periods.

8.4 Price
Each <period> must have at least one <price> (decimal). The currency is the one given with the lename. Prices can be dened in multiple steps within a <period>, depending on the number of persons ("1" "64"). The persons (mandatory attribute) given for one <price> are always considered as max persons for that amount. Within a <lodging> element, no prices should be dened for persons lower than the general min persons dened within the lodging itself. Prices are always understood as total price per day, not by one person. Extras / Discounts must be dened separately.

30

Chapter 8. Daily Prices

CHAPTER

NINE

EXTRAS / DISCOUNTS
9.1 About
Extras are side costs and additional offers. They must be delivered separately to ensure a total price for a booking can be offered, with details on how the price is composed. Discounts are extras that apply under certain restrictions, and whose amount is subtracted from the total price.

9.2 XML
A typical extras_[currency].xml looks like this:
<?xml version="1.0" encoding="UTF-8"?> <extras> <lodging id="152A"> <extra name="Final cleaning" type="CLEANING" mandatory="true" inclusive="false"> <restrictions> <persons min="2" max="5"/> </restrictions> <price paid_on_spot="true"> <interval>NONE</interval> <unit>PERSON</unit> <amount min_total="80">20</amount> </price> <descriptions> <summary> Final cleaning: C20.00 per person, with C80.00 minimum for all. </summary> </descriptions> </extra> <extra name="Final cleaning" type="CLEANING" mandatory="true" inclusive="false"> <restrictions> <persons min="6" max="6"/> </restrictions> <price paid_on_spot="true"> <interval>NONE</interval> <unit>PERSON</unit> <amount>25</amount> </price> <descriptions> <summary>Final cleaning: C25.00 per person.</summary>

31

CASAMUNDO API Documentation, Release 1.2.1

</descriptions> </extra> <extra name="Extra bed" type="OTHER" mandatory="false" inclusive="false"> <restrictions/> <price paid_on_spot="false"> <interval>DAY</interval> <unit>BED</unit> <amount>10</amount> </price> <descriptions> <note>Bedlinen included.</note> <summary>Extra bed: C10.00 each bed per day (bedlinen included).</summary> </descriptions> </extra> <extra name="Visitors tax" type="TAX" mandatory="true" inclusive="false"> <restrictions> <age min="16" max="99"/> <days min="1" max="7"/> </restrictions> <price paid_on_spot="true"> <interval>DAY</interval> <unit>PERSON</unit> <amount>2.5</amount> </price> <descriptions> <note>No tax to be paid for children up to 15 years.</note> <summary> Local taxes: C2.50 per person (included for children up to 15 years). </summary> </descriptions> </extra> <extra name="Visitors tax" type="TAX" mandatory="true" inclusive="false"> <restrictions> <age min="16" max="99"/> <days min="8" max="28"/> </restrictions> <price paid_on_spot="true"> <interval>DAY</interval> <unit>PERSON</unit> <amount>2.0</amount> </price> <descriptions> <note>No tax to be paid for children up to 15 years.</note> <summary> Local taxes: C2.00 per person (included for children up to 15 years). </summary> </descriptions> </extra> <extra name="Short stay charge" type="OTHER" mandatory="true" inclusive="false"> <restrictions> <days min="1" max="4"/> <date from="2013-04-01" to="2013-09-30" coverage="full"/> </restrictions> <price paid_on_spot="false"> <interval>NONE</interval> <unit>BOOKING</unit> <amount relative="true">33.33</amount>

32

Chapter 9. Extras / Discounts

CASAMUNDO API Documentation, Release 1.2.1

</price> <descriptions> <summary>Short stay extra charge 33.33 % on total price.</summary> </descriptions> </extra> <extra name="Last Minute Discount" type="DISCOUNT" mandatory="false" inclusive="fals <restrictions> <anticipation_days min="0" max="3"/> </restrictions> <price paid_on_spot="false" calculation_level="1"> <interval>NONE</interval> <unit>BOOKING</unit> <amount relative="true">50.0</amount> </price> <descriptions> <summary>Last minute discount: 50 % off for bookings up to 3 days before begin.< </descriptions> </extra> </lodging> </extras>

9.3 Extra
Each lodging may have multiple <extra> declarations. The name (string) must be translated into the right language. It should be delivered if possible. There must be a type (enumeration) dened as one of: Type BOARD CLEANING DEPOSIT DISCOUNT OTHER PET TAX Costs related to ... meals (e. g. breakfast, half-board, full-board) cleaning (e. g. nal cleaning, intermediate cleaning) deposit amount is subtracted from total price when restrictions apply everything not matching the other types (to be used as default) pets taxes and public fees

The mandatory attribute (boolean) is required. It must be set to "true" for obligatory extras. The inclusive (boolean) shall indicate whether an extra is already part of the total price which is dened in Weekly Availabilities or Daily Prices. Both inclusive and exclusive extras are listed separately on CASAMUNDO to make prices more transparent and better comparable.

9.4 Restrictions
The <restrictions> element is mandatory, but may be left empty. Its used to make apply an extra cost for bookings matching certain conditions only.

9.3. Extra

33

CASAMUNDO API Documentation, Release 1.2.1

9.4.1 Persons
The <persons> attributes min and max ("1" "64") dene a persons range the extra is valid for. If an extra has different amounts for different person ranges, multiple extras must be delivered with the right ranges set. Both attributes must be set if the element is used.

9.4.2 Age
The <age> attributes min and max ("0" "99") dene an age range. Only persons matching that age range are counted as person the extra may be applied on. Both attributes must be set if the element is used.

9.4.3 Days
If the extra applies only for bookings with certain durations, the <days> element must be used to set a range of min and max (positive byte, usually not more than 28) days. Both attributes must be set if the element is used. They may both have the same value.

9.4.4 Anticipation Days


The anticipation_days element allows specifying the min and max amount of days before the start of the holiday. Only when a booking is made within that range, the discount (or extra) can apply. That way, last minute and early bird discounts can be dened.

9.4.5 Date
A <date> restriction limits the validity of an extra to a certain period, such as Seasons do for whole lodgings. The date given as to may equal from, but not be earlier. The coverage attribute indicates, how from and to must be matched: coverage xed full begin end holiday (accomodation) date range must ... ... match exactly the date range of the extra / discount ... start and end within the extra / discount date range ... start within the extra / discount date range ... end within the extra / discount date range

If the date coverage does not matter at all, omit the whole date element. All three attributes must be set if the element is used.

9.5 Price
The <price> and all its child elements are mandatory. It must occur exactly one time within an extra. The paid_on_spot attribute (boolean) must be "true" when the extra is to be paid on site (after the arrival, not in advance with the booking). Optionally, a calculation_level (positive byte) may indicate at which stage of the price calculation the extra or discount is to be considered. By default, items are taken into account at level 1, thus

34

Chapter 9. Extras / Discounts

CASAMUNDO API Documentation, Release 1.2.1

directly added to / subtracted from the base price. The total price of level 1 will then become the base price for all items of level 2, and so on. The order of calculations is always relevant when there is at least one relative amount to consider.

9.5.1 Interval
The <interval> denes the frequency an amount is due: every DAY, HOUR, WEEK or WEEKEND or only once (NONE no interval).

9.5.2 Unit
The <unit> denes the reference the amount is based on and to be multiplied with. Unit APARTMENT BOOKING BASKET BED BIKE BOAT CAR CHANGE CONSUMPT COURSE CUBMETER DBLBED EXERTION GAME HORSE ITEM KILOGRAM KWHOUR LITER METER OBJECT PACKAGE PERSON PET ROOM SQRMETER WASH WAY Costs per ... apartment booking (should be used if no other unit applies) basket bed (if not DBLBED) bike, bicycle boat car change (bedlinen) consumption (if not CUBMETER, KWHOUR, LITER, METER, SQRMETER) course (lesson, workshop) m double bed exertion game horse a named item kg kWh l m object package person (will be directly applied to the number of persons booked) pet room m waching way

9.5.3 Amount
The <amount> (decimal) of a price refers to its interval and its unit. An amount can be marked as relative with relative="true". The amount will then be calculated in percent of the total price (for all persons and the whole stay, without any other extras).

9.5. Price

35

CASAMUNDO API Documentation, Release 1.2.1

An amount may have a min_total amount (decimal) that always is used as charge for that extra, if the amount calculated by unit and interval would be lower. It should not be delivered if the calculated amount is always valid. The min_total value is always considered absolute, even if the amount itself is declared relative (see above).

9.6 Descriptions
The <descriptions> element is mandatory, but may be left empty. A <note> (string) can be used to add details that are not yet covered by the structured information given in the extra (such as: "bedlinen included" for unit "BED"). The <summary> (string) may outline the characteristics of an extra cost in a few words.

36

Chapter 9. Extras / Discounts

CHAPTER

TEN

SEASONS
10.1 About
Seasons can be used to deliver the same lodging several times, each with adaptions to the period of time it is offered in. The lodgings are called unit when regarded season independent. If seasons are used for any lodgings (which must be declared in the Settings), season ids are used to bind a lodging to a season (see Facilities).

10.2 XML
The seasons itself are dened within a separate seasons.xml:
<?xml version="1.0" encoding="UTF-8"?> <seasons> <season id="A" from_date="2012-04-01" to_date="2012-09-30">Summer 2012</season> <season id="B" from_date="2012-10-01" to_date="2013-03-31">Winter 2012/13</season> </seasons>

The <season id> (([a-zA-Z0-9.-])+) must be unique over all seasons. The to_date must not be earlier than the from_date of the same season. The date ranges of different seasons may overlap as long as overlapping seasons are not refered by the same lodging.

37

CASAMUNDO API Documentation, Release 1.2.1

38

Chapter 10. Seasons

CHAPTER

ELEVEN

XML SCHEMA (XSD)


The XML Schema (XSD) les should be used for validation and detailed reference.

11.1 Settings
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="settings"> <xs:complexType> <xs:sequence> <xs:element ref="provider" maxOccurs="1"/> <xs:element ref="api" maxOccurs="1"/> <xs:element ref="locales" maxOccurs="1"/> <xs:element ref="facility" maxOccurs="1"/> <xs:element ref="lodging" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="provider"> <xs:complexType> <!-- id is deprecated, invalid as of v1.0.0 --> <xs:attribute name="id" use="optional" type="providerIdType"/> <xs:attribute name="name" use="required" type="notEmptyStringType"/> </xs:complexType> </xs:element> <xs:simpleType name="providerIdType"> <xs:restriction base="xs:NMTOKEN"> <xs:minLength value="2" /> <xs:maxLength value="50" /> </xs:restriction> </xs:simpleType> <xs:element name="api"> <xs:complexType> <xs:sequence> <xs:element ref="version" maxOccurs="1"/> <!-- extensions are deprecated, probably invalid as of v1.0.0 --> <xs:element ref="extensions" minOccurs="0" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="version"> <xs:simpleType>

39

CASAMUNDO API Documentation, Release 1.2.1

<xs:restriction base="xs:token"> <xs:pattern value="1\.2"/> <xs:pattern value="1\.2\.\d"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="extensions"> <xs:complexType/> </xs:element> <xs:element name="locales"> <xs:complexType> <xs:sequence> <xs:element ref="locale" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="locale"> <xs:complexType> <xs:attribute name="currency" use="required"> <xs:simpleType> <xs:restriction base="xs:NCName"> <xs:enumeration value="CZK"/> <xs:enumeration value="EUR"/> <xs:enumeration value="GBP"/> <xs:enumeration value="PLN"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:attribute name="language" use="required"> <xs:simpleType> <xs:restriction base="xs:NCName"> <xs:enumeration value="CZ"/> <xs:enumeration value="DE"/> <xs:enumeration value="EN"/> <xs:enumeration value="ES"/> <xs:enumeration value="FR"/> <xs:enumeration value="HU"/> <xs:enumeration value="IT"/> <xs:enumeration value="NL"/> <xs:enumeration value="PL"/> <xs:enumeration value="SK"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element> <xs:element name="facility"> <xs:complexType> <xs:sequence> <xs:element ref="lodgings" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="lodgings"> <xs:simpleType> <xs:restriction base="xs:token"> <xs:enumeration value="SINGLE"/>

40

Chapter 11. XML Schema (XSD)

CASAMUNDO API Documentation, Release 1.2.1

<xs:enumeration value="MULTIPLE"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="lodging"> <xs:complexType> <xs:sequence> <!-- deliver both only if weekly availabilities can not be calculated from daily <xs:element ref="availabilities" maxOccurs="2"/> </xs:sequence> <xs:attribute name="seasons" use="required" type="booleanType"/> </xs:complexType> </xs:element> <xs:element name="availabilities"> <xs:complexType> <xs:attribute name="type" use="required" type="availabilitiesTypeType"/> <xs:attribute name="changeover" use="required" type="availabilitiesChangeoverType" </xs:complexType> </xs:element> <xs:simpleType name="availabilitiesTypeType"> <xs:restriction base="xs:token"> <xs:enumeration value="DAILY"/> <xs:enumeration value="WEEKLY"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="availabilitiesChangeoverType"> <xs:restriction base="xs:token"> <!-- use "MAP" for daily availabilities only --> <xs:enumeration value="MAP"/> <!-- use the weekday for weekly availabilities only --> <xs:enumeration value="MON"/> <xs:enumeration value="TUE"/> <xs:enumeration value="WED"/> <xs:enumeration value="THU"/> <xs:enumeration value="FRI"/> <xs:enumeration value="SAT"/> <xs:enumeration value="SUN"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="booleanType"> <xs:restriction base="xs:NCName"> <xs:enumeration value="TRUE"/> <xs:enumeration value="FALSE"/> <xs:enumeration value="true"/> <xs:enumeration value="false"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="notEmptyStringType"> <xs:restriction base="xs:token"> <xs:minLength value="1"/> <xs:maxLength value="255"/> </xs:restriction> </xs:simpleType> </xs:schema>

11.1. Settings

41

CASAMUNDO API Documentation, Release 1.2.1

11.2 Facilities
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="facilities"> <xs:complexType> <xs:sequence> <xs:element ref="facility" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="facility"> <xs:complexType> <xs:sequence> <xs:element ref="geodata" maxOccurs="1"/> <xs:element ref="descriptions" maxOccurs="1"/> <xs:element ref="images" maxOccurs="1"/> <xs:element ref="lodgings" maxOccurs="1"/> </xs:sequence> <xs:attribute name="id" use="required" type="idType"/> <xs:attribute name="name" use="required" type="notEmptyStringType"/> </xs:complexType> </xs:element> <xs:element name="geodata"> <xs:complexType> <xs:sequence> <xs:element ref="location" maxOccurs="1"/> <xs:element ref="position" maxOccurs="1"/> <xs:element ref="distances" maxOccurs="1"/> <xs:element ref="nearby" minOccurs="0" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="location"> <xs:complexType> <xs:sequence> <xs:element ref="country" maxOccurs="1"/> <xs:element ref="region" maxOccurs="1"/> <xs:element ref="area" minOccurs="0" maxOccurs="1"/> <xs:element ref="zip" minOccurs="0" maxOccurs="1"/> <xs:element ref="place" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="country" type="notEmptyStringType"/> <xs:element name="region" type="notEmptyStringType"/> <xs:element name="area" type="limitedStringType"/> <xs:element name="zip" type="limitedStringType"/> <xs:element name="place" type="notEmptyStringType"/> <xs:element name="position"> <xs:complexType> <xs:sequence> <xs:element ref="latitude" minOccurs="0" maxOccurs="1"/> <xs:element ref="longitude" minOccurs="0" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element>

42

Chapter 11. XML Schema (XSD)

CASAMUNDO API Documentation, Release 1.2.1

<xs:element name="latitude"> <xs:simpleType> <xs:restriction base="xs:decimal"> <xs:minInclusive value="-90.0"/> <xs:maxInclusive value="90.0"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="longitude"> <xs:simpleType> <xs:restriction base="xs:decimal"> <xs:minInclusive value="-180.0"/> <xs:maxInclusive value="180.0"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="distances"> <xs:complexType> <xs:sequence> <xs:element ref="distance" minOccurs="0" maxOccurs="5"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="distance"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:unsignedInt"> <xs:attribute name="type" use="required"> <xs:simpleType> <xs:restriction base="xs:NCName"> <xs:enumeration value="AIRPORT"/> <xs:enumeration value="CITY"/> <xs:enumeration value="FISHING"/> <xs:enumeration value="RESTAURANT"/> <xs:enumeration value="SHOPPING"/> <xs:enumeration value="SKIING"/> <xs:enumeration value="WATER"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name="nearby"> <xs:complexType> <xs:sequence> <xs:element ref="airport" minOccurs="0" maxOccurs="1"/> <xs:element ref="beach" minOccurs="0" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="airport" type="limitedStringType"/> <xs:element name="beach" type="limitedStringType"/> <xs:element name="descriptions"> <xs:complexType> <xs:sequence>

11.2. Facilities

43

CASAMUNDO API Documentation, Release 1.2.1

<xs:element ref="description" minOccurs="0" maxOccurs="5"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="description"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="type" use="required"> <xs:simpleType> <xs:restriction base="xs:NCName"> <xs:enumeration value="FACILITY"/> <xs:enumeration value="SURROUND"/> <xs:enumeration value="VIEW"/> <xs:enumeration value="DISTANCES"/> <xs:enumeration value="OTHER"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name="images"> <xs:complexType> <xs:sequence> <xs:element ref="image" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="image"> <xs:complexType> <xs:sequence> <xs:element ref="url" maxOccurs="1"/> <xs:element ref="title" minOccurs="0" maxOccurs="1"/> </xs:sequence> <!-- preview is listed here for backward compatibility only, use priority instead --> <xs:attribute name="preview" use="optional" type="booleanType"/> <xs:attribute name="priority" use="optional" type="positiveByteType"/> <!-- season is listed here for backward compatibility only, use time_of_year instead --> <xs:attribute name="season" use="optional" type="limitedStringType"/> <xs:attribute name="time_of_year" use="optional"> <xs:simpleType> <xs:restriction base="xs:NCName"> <xs:enumeration value="SUMMER"/> <xs:enumeration value="WINTER"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:attribute name="type" use="optional"> <xs:simpleType> <xs:restriction base="xs:NCName"> <xs:enumeration value="INDOOR"/> <xs:enumeration value="OUTDOOR"/> <xs:enumeration value="SURROUND"/>

44

Chapter 11. XML Schema (XSD)

CASAMUNDO API Documentation, Release 1.2.1

<xs:enumeration value="VIEW"/> <xs:enumeration value="GROUNDPLAN"/> <xs:enumeration value="SKIPLAN"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element> <xs:element name="url" type="xs:anyURI"/> <xs:element name="title" type="limitedStringType"/> <xs:element name="lodgings"> <xs:complexType> <xs:choice> <xs:element ref="unit" maxOccurs="unbounded"/> <xs:element ref="lodging" maxOccurs="unbounded"/> </xs:choice> <!-- deprecated, naming kind of seasons is not used --> <xs:attribute name="seasons" use="optional" type="xs:token"/> </xs:complexType> </xs:element> <xs:element name="unit"> <xs:complexType> <xs:sequence> <xs:element ref="lodging" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="id" use="required" type="idType"/> </xs:complexType> </xs:element> <xs:element name="lodging"> <xs:complexType> <xs:attribute name="id" use="required" type="idType"/> <xs:attribute name="season_id" use="optional" type="idType"/> </xs:complexType> </xs:element> <xs:simpleType name="idType"> <xs:restriction base="notEmptyStringType"> <xs:pattern value="([a-zA-Z0-9.-])+"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="booleanType"> <xs:restriction base="xs:NCName"> <xs:enumeration value="TRUE"/> <xs:enumeration value="FALSE"/> <xs:enumeration value="true"/> <xs:enumeration value="false"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="positiveByteType"> <xs:restriction base="xs:unsignedByte"> <xs:minInclusive value="1"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="notEmptyStringType"> <xs:restriction base="xs:token"> <xs:minLength value="1"/> <xs:maxLength value="255"/> </xs:restriction>

11.2. Facilities

45

CASAMUNDO API Documentation, Release 1.2.1

</xs:simpleType> <xs:simpleType name="limitedStringType"> <xs:restriction base="xs:token"> <xs:minLength value="0"/> <xs:maxLength value="255"/> </xs:restriction> </xs:simpleType> </xs:schema>

11.3 Lodgings 11.4 Weekly Availabilities


<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="availabilities"> <xs:complexType> <xs:sequence> <xs:element ref="lodging" maxOccurs="unbounded"/> </xs:sequence> <!-- type="WEEKLY" is deprecated --> <xs:attribute name="type" use="optional" type="xs:token"/> </xs:complexType> </xs:element> <xs:element name="lodging"> <xs:complexType> <xs:sequence> <xs:element ref="availability" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="id" use="required" type="idType"/> <xs:attribute name="changeover" use="optional"> <xs:simpleType> <xs:restriction base="xs:NCName"> <xs:enumeration value="MON"/> <xs:enumeration value="TUE"/> <xs:enumeration value="WED"/> <xs:enumeration value="THU"/> <xs:enumeration value="FRI"/> <xs:enumeration value="SAT"/> <xs:enumeration value="SUN"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element> <xs:element name="availability"> <xs:complexType> <xs:sequence> <xs:element ref="price" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="from_date" use="required" type="xs:date"/> <xs:attribute name="to_date" use="required" type="xs:date"/> <xs:attribute name="type" use="required"> <xs:simpleType>

46

Chapter 11. XML Schema (XSD)

CASAMUNDO API Documentation, Release 1.2.1

<xs:restriction base="xs:NCName"> <xs:enumeration value="VACANT"/> <xs:enumeration value="REQUEST"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element> <xs:element name="price"> <xs:complexType> <xs:simpleContent> <xs:extension base="priceType"> <xs:attribute name="persons_max" use="required" type="personsType"/> <xs:attribute name="persons_min" use="required" type="personsType"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:simpleType name="idType"> <xs:restriction base="notEmptyStringType"> <xs:pattern value="([a-zA-Z0-9.-])+"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="priceType"> <xs:restriction base="xs:decimal"> <xs:minExclusive value="0.0"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="personsType"> <xs:restriction base="xs:unsignedByte"> <xs:minInclusive value="1"/> <xs:maxInclusive value="64"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="notEmptyStringType"> <xs:restriction base="xs:token"> <xs:minLength value="1"/> <xs:maxLength value="255"/> </xs:restriction> </xs:simpleType> </xs:schema>

11.5 Daily Availabilities


<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="availabilities"> <xs:complexType> <xs:sequence> <xs:element ref="availability" maxOccurs="unbounded"/> </xs:sequence> <!-- type="DAILY" is deprecated --> <xs:attribute name="type" use="optional" type="xs:token"/> </xs:complexType> </xs:element>

11.5. Daily Availabilities

47

CASAMUNDO API Documentation, Release 1.2.1

<xs:element name="availability"> <xs:complexType> <xs:sequence> <xs:element ref="from_date" maxOccurs="1"/> <xs:element ref="vacancy" maxOccurs="1"/> <xs:element ref="changeover" maxOccurs="1"/> <xs:element ref="minstay" maxOccurs="1"/> </xs:sequence> <xs:attribute name="lodging_id" use="required" type="idType"/> </xs:complexType> </xs:element> <xs:element name="from_date" type="xs:date"/> <xs:element name="vacancy"> <xs:complexType mixed="true"> <xs:simpleContent> <xs:extension base="vacancyType"> <xs:attribute name="type" use="required" type="perDayAllDaysType"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name="changeover"> <xs:complexType mixed="true"> <xs:simpleContent> <xs:extension base="changeoverType"> <xs:attribute name="type" use="required" type="perDayAllDaysType"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name="minstay"> <xs:complexType mixed="true"> <xs:simpleContent> <xs:extension base="minstayType"> <xs:attribute name="type" use="required" type="perDayAllDaysType"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:simpleType name="idType"> <xs:restriction base="notEmptyStringType"> <xs:pattern value="([a-zA-Z0-9.-])+"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="perDayAllDaysType"> <xs:restriction base="xs:token"> <xs:enumeration value="ALL_DAYS"/> <xs:enumeration value="PER_DAY"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="vacancyType"> <xs:restriction base="xs:normalizedString"> <xs:pattern value="([012 ])+"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="changeoverType"> <xs:restriction base="xs:normalizedString">

48

Chapter 11. XML Schema (XSD)

CASAMUNDO API Documentation, Release 1.2.1

<xs:pattern value="([0123 ])+"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="minstayType"> <xs:restriction base="xs:normalizedString"> <xs:pattern value="([A-Z ])+"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="notEmptyStringType"> <xs:restriction base="xs:token"> <xs:minLength value="1"/> <xs:maxLength value="255"/> </xs:restriction> </xs:simpleType> </xs:schema>

11.6 Daily Prices


<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="prices"> <xs:complexType> <xs:sequence> <xs:element ref="lodging" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="lodging"> <xs:complexType> <xs:sequence> <xs:element ref="period" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="id" use="required" type="idType"/> </xs:complexType> </xs:element> <xs:element name="period"> <xs:complexType> <xs:sequence> <xs:element ref="price" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="date_from" use="required" type="xs:date"/> <xs:attribute name="date_to" use="required" type="xs:date"/> </xs:complexType> </xs:element> <xs:element name="price"> <xs:complexType> <xs:simpleContent> <xs:extension base="priceType"> <xs:attribute name="persons" use="required" type="personsType"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:simpleType name="idType"> <xs:restriction base="notEmptyStringType">

11.6. Daily Prices

49

CASAMUNDO API Documentation, Release 1.2.1

<xs:pattern value="([a-zA-Z0-9.-])+"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="priceType"> <xs:restriction base="xs:decimal"> <xs:minExclusive value="0.0"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="personsType"> <xs:restriction base="xs:unsignedByte"> <xs:minInclusive value="1"/> <xs:maxInclusive value="64"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="notEmptyStringType"> <xs:restriction base="xs:token"> <xs:minLength value="1"/> <xs:maxLength value="255"/> </xs:restriction> </xs:simpleType> </xs:schema>

11.7 Extras
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="extras"> <xs:complexType> <xs:sequence> <xs:element ref="lodging" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="lodging"> <xs:complexType> <xs:sequence> <xs:element ref="extra" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="id" use="required" type="idType"/> </xs:complexType> </xs:element> <xs:element name="extra"> <xs:complexType> <xs:sequence> <xs:element ref="restrictions" maxOccurs="1"/> <xs:element ref="price" maxOccurs="1"/> <xs:element ref="descriptions" maxOccurs="1"/> </xs:sequence> <!-- the name will be required and notEmptyStringType as from 1.0.0 --> <xs:attribute name="name" use="optional" type="limitedStringType"/> <!-- booleans must be lowercase as of 1.0.0 --> <xs:attribute name="inclusive" use="required" type="booleanType"/> <xs:attribute name="mandatory" use="required" type="booleanType"/>

50

Chapter 11. XML Schema (XSD)

CASAMUNDO API Documentation, Release 1.2.1

<xs:attribute name="type" use="required"> <xs:simpleType> <xs:restriction base="xs:NCName"> <xs:enumeration value="BOARD"/> <xs:enumeration value="CLEANING"/> <xs:enumeration value="DEPOSIT"/> <xs:enumeration value="DISCOUNT"/> <xs:enumeration value="OTHER"/> <xs:enumeration value="PET"/> <xs:enumeration value="TAX"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element> <xs:element name="restrictions"> <xs:complexType> <xs:choice minOccurs="0" maxOccurs="5"> <xs:element ref="age" minOccurs="0" maxOccurs="1"/> <xs:element ref="anticipation_days" minOccurs="0" maxOccurs="1"/> <xs:element ref="date" minOccurs="0" maxOccurs="1"/> <xs:element ref="days" minOccurs="0" maxOccurs="1"/> <xs:element ref="persons" minOccurs="0" maxOccurs="1"/> </xs:choice> </xs:complexType> </xs:element> <xs:element name="persons"> <xs:complexType> <xs:attribute name="max" use="required" type="personsType"/> <xs:attribute name="min" use="required" type="personsType"/> </xs:complexType> </xs:element> <xs:element name="age"> <xs:complexType> <xs:attribute name="max" use="required" type="ageType"/> <xs:attribute name="min" use="required" type="ageType"/> </xs:complexType> </xs:element> <xs:element name="days"> <xs:complexType> <xs:attribute name="max" use="required" type="positiveByteType"/> <xs:attribute name="min" use="required" type="positiveByteType"/> </xs:complexType> </xs:element> <xs:element name="anticipation_days"> <xs:complexType> <xs:attribute name="max" use="required" type="xs:unsignedByte"/> <xs:attribute name="min" use="required" type="xs:unsignedByte"/> </xs:complexType> </xs:element> <xs:element name="date"> <xs:complexType> <!-- booleans must be lowercase as of 1.0.0 --> <!-fixed deprecated as of 1.2.0, use coverage attribute instead: fixed="true" => coverage="fixed" fixed="false" => coverage="full"

11.7. Extras

51

CASAMUNDO API Documentation, Release 1.2.1

//--> <xs:attribute name="coverage" use="required" type="coverageType"/> <xs:attribute name="fixed" use="optional" type="booleanType"/> <xs:attribute name="from" use="required" type="xs:date"/> <xs:attribute name="to" use="required" type="xs:date"/> </xs:complexType> </xs:element> <xs:element name="price"> <xs:complexType> <xs:sequence> <xs:element ref="interval" maxOccurs="1"/> <xs:element ref="unit" maxOccurs="1"/> <xs:element ref="amount" maxOccurs="1"/> </xs:sequence> <!-- booleans must be lowercase as of 1.0.0 --> <xs:attribute name="paid_on_spot" use="required" type="booleanType"/> <xs:attribute name="calculation_level" use="optional" type="positiveByteType"/> </xs:complexType> </xs:element> <xs:element name="interval"> <xs:simpleType> <xs:restriction base="xs:NCName"> <xs:enumeration value="NONE"/> <xs:enumeration value="DAY"/> <xs:enumeration value="HOUR"/> <!-- STAY is deprecated, use NONE instead --> <xs:enumeration value="STAY"/> <xs:enumeration value="WEEK"/> <xs:enumeration value="WEEKEND"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="unit"> <xs:simpleType> <xs:restriction base="xs:NCName"> <xs:enumeration value="APARTMENT"/> <xs:enumeration value="BOOKING"/> <xs:enumeration value="BASKET"/> <xs:enumeration value="BED"/> <xs:enumeration value="BIKE"/> <xs:enumeration value="BOAT"/> <xs:enumeration value="CAR"/> <xs:enumeration value="CHANGE"/> <xs:enumeration value="CONSUMPT"/> <xs:enumeration value="COURSE"/> <xs:enumeration value="CUBMETER"/> <xs:enumeration value="DBLBED"/> <!-- EACH is deprecated, use ITEM instead --> <xs:enumeration value="EACH"/> <xs:enumeration value="EXERTION"/> <xs:enumeration value="GAME"/> <xs:enumeration value="HORSE"/> <xs:enumeration value="ITEM"/> <xs:enumeration value="KILOGRAM"/> <xs:enumeration value="KWHOUR"/> <xs:enumeration value="LITER"/> <xs:enumeration value="METER"/>

52

Chapter 11. XML Schema (XSD)

CASAMUNDO API Documentation, Release 1.2.1

<xs:enumeration value="OBJECT"/> <xs:enumeration value="PACKAGE"/> <xs:enumeration value="PERSON"/> <xs:enumeration value="PET"/> <xs:enumeration value="ROOM"/> <xs:enumeration value="SQRMETER"/> <xs:enumeration value="WASH"/> <xs:enumeration value="WAY"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="amount"> <xs:complexType> <xs:simpleContent> <xs:extension base="priceType"> <xs:attribute name="min_total" use="optional" type="priceType"/> <xs:attribute name="relative" use="optional" type="xs:boolean"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name="descriptions"> <xs:complexType> <xs:sequence> <xs:element ref="note" minOccurs="0" maxOccurs="1"/> <xs:element ref="summary" minOccurs="0" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="note" type="limitedStringType"/> <xs:element name="summary" type="limitedStringType"/> <xs:simpleType name="idType"> <xs:restriction base="notEmptyStringType"> <xs:pattern value="([a-zA-Z0-9.-])+"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="priceType"> <xs:restriction base="xs:decimal"> <xs:fractionDigits value="2"/> <xs:minInclusive value="0.00"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="booleanType"> <xs:restriction base="xs:NCName"> <xs:enumeration value="TRUE"/> <xs:enumeration value="FALSE"/> <xs:enumeration value="true"/> <xs:enumeration value="false"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="coverageType"> <xs:restriction base="xs:NCName"> <xs:enumeration value="fixed"/> <xs:enumeration value="full"/> <xs:enumeration value="begin"/> <xs:enumeration value="end"/> </xs:restriction>

11.7. Extras

53

CASAMUNDO API Documentation, Release 1.2.1

</xs:simpleType> <xs:simpleType name="personsType"> <xs:restriction base="xs:unsignedByte"> <xs:minInclusive value="1"/> <xs:maxInclusive value="64"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="ageType"> <xs:restriction base="xs:unsignedByte"> <xs:minInclusive value="0"/> <xs:maxInclusive value="99"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="positiveByteType"> <xs:restriction base="xs:unsignedByte"> <xs:minInclusive value="1"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="notEmptyStringType"> <xs:restriction base="xs:token"> <xs:minLength value="1"/> <xs:maxLength value="255"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="limitedStringType"> <xs:restriction base="xs:token"> <xs:minLength value="0"/> <xs:maxLength value="255"/> </xs:restriction> </xs:simpleType> </xs:schema>

11.8 Seasons
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="seasons"> <xs:complexType> <xs:sequence> <xs:element ref="season" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="season"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:token"> <xs:attribute name="id" use="required" type="idType"/> <xs:attribute name="from_date" use="required" type="xs:date"/> <xs:attribute name="to_date" use="required" type="xs:date"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:simpleType name="idType">

54

Chapter 11. XML Schema (XSD)

CASAMUNDO API Documentation, Release 1.2.1

<xs:restriction base="notEmptyStringType"> <xs:pattern value="([a-zA-Z0-9.-])+"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="notEmptyStringType"> <xs:restriction base="xs:token"> <xs:minLength value="1"/> <xs:maxLength value="255"/> </xs:restriction> </xs:simpleType> </xs:schema>

11.8. Seasons

55

Вам также может понравиться