Elements

This is a list of the elements that make up the Playing card specification.

The DeckData element

Overview

A deckData element is the root element of the document, containing all other elements in the document. It can commonly appear as the root of a XML document, the root of a JSON document, or inside the metadata element of a SVG document.

A DeckData should be in its own JSON or XML document if it describes a deck whose images are in a bitmap format or if the images are all in individual files. A DeckData should be included in the metadata of a SVG file if all images for the deck are contained inside the SVG file.

Possible Children

In any order:

The Suit element

Overview

All cards are organized into suits.

Possible Children

In any order:

Attributes

suit_like="SUIT_LIKE"
The attribute that matters of these is the suit_like attribute. It can be one of an enumerated list of values. Documents may give each suit one of these values as a hint to games as to which of the most common suits a decks' suit is analogous to. A game may use these values to determine which suit to use for a particular purpose for example, a game of hearts could look for a suit marked suit_like="HEARTS" to use as the point cards. However, a game must not fail if a deck chosen does not have suit_likes or an expected suit_like.
template="ID_REF"
This references a suit_template element. The ID_REF must be a reference to a Suit_Template element. When a suit contains a template attribute, it must be treated as if all rank children of the referenced suit_template are contained in the current suit.

The Suit_Template element

Overview

Oftentimes, card decks have multiple suits with each suit containing similar cards. In fact, that is probably the point of having suits in the first place. A suit template is a way to define the ranks contained by multiple suits in a single place. When a suit or suit template has an element referenced by

Possible Children

In any order:

Attributes

xml:id="ID"
Necessary for a template to be referenced by another element
template="ID_REF"
Yes, this is recursive. The ID_REF must be a reference to a Suit_Template element. When a suit contains a template attribute, it must be treated as if all rank children of the referenced suit_template are contained in the current suit. A document must not contain any circular dependencies.

The Backs element

Overview

The backs element contains a list of possible backs of a deck of cards.

Possible Children

In any order:

The Rank element

Overview

These are the lowest level of card hierarchy. Each rank represents one type of card, based on both itself and the suit or backs element that contains it.

Possible Children

In any order:

Attributes

rank="INT"
This defines how strong a card is compared to other cards. Each rank should have a unique rank value. A rank must contain either a rank attribute or a trump attribute, but not both.
trump=""
No more than one rank in a suit may contain the trump attribute. It indicates that it will win against other cards whether the game is high-wins or low-wins. A rank must contain either a rank attribute or a trump attribute, but not both.

The Suit_name element

Overview

Each suit's name is based on the suit_name elements it contains. If a suit has multiple suit_name children, each suit_name must define a different xml:lang value.

Attributes

xml:lang="LANG-CODE"
this defines the language of the contents. Only one name should be shown per suit, depending on the language of the system and/or application. As always, xml:lang is inherited from parents. Each sibling suit_name must have a different language.

Possible Children

Contains text data

The card_name element

Overview

Like each suit has a name, so to each card has a name. However, unlike suit_names, a card_name is based both on its rank and its suit. Therefore, both suits and ranks can contain card_name attributes.

The names are combined by replacing all (^) sequences inside the textual data of the suit's card_name child with the textual data of the rank's card_name child. For example, a sequence like (^) of Spades Ace ]]> would result in a card's name of Ace of Spaces

Attributes

xml:lang="LANG-CODE"
this defines the language of the contents. Only one name should be shown per card, depending on the language of the system and/or application. As always, xml:lang is inherited from parents. Each sibling card_name must have a different language.

Possible Children

Contains text data