d20ML

Introduction

20ML is a d20 content markup language. It is not restricted for use under the d20 STL, although it is designed for this use.

d20ML is an XML vocabulary for representing common d20 roleplaying concepts, like characters, spells, and feats. There will eventually be tools that transform d20ML content into a variety of more useable forms, such as formatted HTML, PDF, and maybe others.

Currently, d20ML consists of this document, nothing more. There are no tools, no documents other than the examples here. It may develop into something more, but there is no guarantee that this will ever happen. I have a real life, too.

An Example Document

<document id="SampleDocument"
          xmlns="http://d20ML.svincent.com/">
  <name>A sample Document</name>
  <summary>A simple example document, to prove a point</summary>

  <body>

    <section id="Introduction">
      <name>Introduction</name>
      <summary>An optional summary of this section.</summary>

      <body>
	<p>Some normal paragraph text.  Paragraphs contain text and
	other <strong>inline</strong> elements.</p>
      </body>
    </section>

    <item id="Boot">
      <name>Boot</name>
      <weight>2 lb</weight>
      <cost>4 gp</cost>
      <summary>Hard external foot coverings.</summary>

      <description>
	<p>Some explanatory text about boots</p>

	<p>Can have links to <a href="srd.xml#Monster-Griffon">
        other objects.</a> </p>
      </description>
    </section>

  </body>

</document>
     

Basic Document Structure

Namespace

All core elements in d20ML use the following namespace URI: http://d20ML.svincent.com/

The <document> element

Every d20ML document contains, at its top-level, a <document> element. This element will contain a nested name element, a nested summary element, and zero or more object elements.

Object elements

Object elements correspond to objects in the roleplaying world. Characters, items, spells, gods, and feats are all represented as object elements.

Also, block-level objects in the document itself are also object elements (such as paragraphs and tables).

Object elements are rendered as block-level elements. That is, when rendered, they will occupy a rectangular region of screen real estate.

Object elements can have IDs, specified by an id attribute on the object element tag. They can then be referred to by Object Element URIs, described below.

The basic structure of an object element follows.

<tagName id="ObjectID">
  <name>Name of object (usually required)</name>
  <summary>Summary of object (usually optional)</summary>

  <!-- Contents: other element-specific children. -->

</tagName>
     

Examples follow.

<item id="Item-Sword">
  <name>Sword</name>
  <summary>Sharp object for hurting people.</summary>
  <price>20gp</price>
  <weight>2lb</weight>
  <description>
    <p>This is your normal sword, basically.</p>
  </description>
</item>

<section id="Section-Introduction">
  <name>Introduction</name>
  <summary>A basic introduction.</summary>
  <body>
    <p>This is your normal sword, basically.</p>
  </body>
</section>
     

Attribute elements

Many Object elements have one or more 'attributes', which are named properties associated with the node.

They look like this:

<name>Value here, maybe with inline markup</name>
     

Examples follow.

<price>20gp</price>

<weight>2lb</weight>

<friend>friends.xml#Friend-Fred</friend>

<body>
  <p>Attributes may contain object tags.</p>
</body>
     

Object Element URIs

Often, you will want to refer to an object in your document, typically as a link. For this reason, d20ML provides Object Element URIs, which are unique URIs corresponding

The structure of such an URI is straightforward: it consists of the URI of the containing document file, with a fragment identifier equal to the object's ID appended.

For example:

http://www.svincent.com/d20/srd/srd.xml#Monster-UmberHulk

http://www.svincent.com/d20/Phade/characters.xml#Character-VishusVeeZul
     

The <ref> Tag

Sometimes, you want to include an object in more than one document. This can be used to include a character in more than one adventure, or just to reuse text (sortof an include mechanism).

The core of this mechanism is the <ref> tag. An example to illustrate:

<ref href="newFeats.xml#Feat-FireEyes"/>
     

Using the <ref> tag is exactly equivalent to placing the object inline. In this way, you can seperate objects into files independently of what document structure you would like them to have, as well as reuse content without copying-and-pasting.

Issues