Loading ...
Sorry, an error occurred while loading the content.

On Common Elements

Expand Messages
  • Keith Davies
    Hi All, This describes some of the common (nearly ubiquitous) elements and attributes used. It is not complete (I ve got to get back to work); I ll be
    Message 1 of 2 , Oct 22, 2002
    • 0 Attachment
      Hi All,

      This describes some of the common (nearly ubiquitous) elements and
      attributes used. It is not complete (I've got to get back to work);
      I'll be updating it soon.

      K.


      PCGen-XML Design: Common Element Information
      last updated 2002/10/22

      Introduction

      This document describes common aspects of elements used in PCGen-XML
      files. Included are common elements (such as <name> and <ref>) and
      attributes (@id and @key).

      As a shorthand notation, I tend to use <element> when discussing an
      element of name 'element', and @att when discussing an attribute of
      name 'att' (substitute text found as needed, of course).

      Common Attributes

      @id

      This is a unique identifier. It will identify a single element
      in memory. It is not necessarily unique within the entire system,
      however; it is possible for several elements to have exactly the
      same identifier if they in fact describe the same thing. An
      example may be found in the splat book _Sword and Fist_ (a feat
      is duplicated from another book).

      @name

      The name of the item being described.

      This was originally an attribute, then was moved out of the
      attributes and made an element so that more than one could be
      contained by a single element. Each was expected to belong
      to a different language.

      I've come to the conclusion that this is not the best way to
      do it. The effort required to maintain each element as new
      languages are added would become prohibitive and probably
      error-prone. Instead, my recommended way to handle this is
      to use whatever language the source document was originally
      prepared in (probably English) then have an overlay file that
      changes the name attribute of the items as needed. This puts
      all languages changes for a document into a single file where
      it is easily maintained and reduces the changes necessary to
      the parent file (which, incidentally, may have been reviewed
      and signed off by the publisher; going this route will remove
      the need to send the file for review again).

      Common Elements

      <source>

      This element identifies the source of the element being described.
      Each significant element may have one <source> child element. If
      a process is trying to find information that would be described in
      a <source> element but it is not present, move up the chain in the
      file to find it (example below).

      <source> is always an optional element.

      <document>

      This element identifies the document being encoded. This
      includes the title, possibly the ISBN, and may have links to
      the publisher's web site, a page in that site that describes
      or contains the document text. For instance, a <document>
      describing the SRD would link to
      http://www.opengamingfoundation.org/srd.html

      <subdocument>

      This element identifies the section of the document being
      encoded, such as the chapter or web page. This might be as
      simple as 'Chapter 3: Magic' or a direct link to the web
      page. For instance, when encoding the SRD you might see
      http://www.opengamingfoundation.org/srd/srdequipmenti.html
      in this element if encoding weapon stats.

      Example:

      <file id="file.srd.weapons">
      <source>
      <document site="http://opengamingfoundation.org"
      page="/srd.html" />
      <publisher ref="pub.wotc"/>
      </source>

      <weapons>
      <source>
      <subdocument page="/srd/equipmenti.html" />
      </source>

      <weapon id="weapon.longsword">
      <!-- weapon information -->
      <source>
      <subdocument page="/src/equipmenti.html#longsword" />
      </source>
      </weapon>

      <weapon id="weapon.dagger">
      <!-- weapon information -->
      <source>
      <subdocument page="/src/equipmenti.html#dagger" />
      </source>
      </weapon>
      </weapons>
      </file>


      { Hmm... for reading convenience, consider abstracting the URL
      information; define a number of web sites and then refer to
      those definitions when needed. This'll reduce the amount of
      redundancy and make it easier to maintain if the URL changes
      }

      If I want to display the source information for longsword, I
      first look in the <weapon> for it's source information. If I
      don't find what I want in there, I work up the chain (to the
      <weapons> first, then the <file>) until I have everything I
      want or there's nothing left to find.

      This allows me to define common information at the top of the
      file (such as the book title, etc.) and use that information
      throughout the file, but still allow me to override it for
      certain sections (as I do with <subdocument> in <weapons>
      and the two <weapon> elements).


      Keith
      --
      Keith Davies
      keith.davies@...

      PCGen: <reaper/>, smartass
      "You just can't argue with a moron. It's like handling Nuclear
      waste. It's not good, it's not evil, but for Christ's sake, don't
      get any on you!!" -- Chuck, PCGen mailing list
    • Mynex
      Calling all Primates (okay, and you other animals as well)!!!! Code Monkey Publishing, LLC is proud to announce that it s zoo has been cleaned up, all (okay,
      Message 2 of 2 , Jan 20, 2003
      • 0 Attachment

         

         

        Calling all Primates (okay, and you other animals as well)!!!!

         

        Code Monkey Publishing, LLC is proud to announce that it’s zoo has been cleaned up, all (okay, most of it) the debris from reconstruction is out of the way! 

         

        So come check us out!!!

         

        *WARNING – This zoo contains dangerous animals and the cages aren’t very secure.  Beware for small children, old people with heart conditions, and well, pretty much anything that breathes.

         

        We still have some ‘prettifying’ to do, but the core bits and bolts are in place… if you have signed up on the forums before, you’ll now be able to log in at the main screen and get to everything at once. :)

         

        If you haven’t signed up, shame on you!  Do so before we release the Ninja Monkeys on you!!

         

         

        Mynex

        - Code Monkey Publishing Co-Founder (www.codemonkeypublishing.com)

        - PCGen's #1 Evil Assistant

        - PCGen Data & Doc Silverback

         

         

      Your message has been successfully submitted and would be delivered to recipients shortly.