[DGD] XML

Christopher Allen ChristopherA at skotos.net
Tue Feb 18 02:55:02 CET 2003


<kevinc at seaplace.org>:
> Has anybody built a XML parser and/or DTD validator for DGD?
>
> Does such a request even make sense?  I'm thinking along the lines of
> being able to pass DTD/XML documents to a DGD object and have that
object
> being able to respond to queries about the XML document.
>
> It gets more complicated when I start thinking about multi DGD
instances
> communicating between themselves via XML, but one thing at a time.

All of the Skotos games use XML for exchange, i.e. internally objects
are stored as DGD persistent objects, but all can be exported and
imported as XML. We make no attempt to try to be totally faithful to the
various XML issues like DTD vs. Schemes, etc. We also have some XML
'shortcuts', dynamic object handles, and an XML control language called
SAM, that allow us to do interesting things with dynamic content that
might break a purist XML parser.

However, that we do as much as we do with XML and have multiple games
proves at least it can be done.

Enclosed is a simple example rose in our example directory, that shows
our XML for a simple object.

-- Christopher Allen

------------------------------------------------------------------------
.. Christopher Allen                                 Skotos Tech Inc. ..
..                           1512 Walnut St., Berkeley, CA 94709-1513 ..
.. <http://www.skotos.net>           o510/647-2760x202  f510/647-2761 ..



<object id="OBJ(Examples:complete:desc:rose-red-w/thorns)">
  <context/>
  <Base:Thing>
    <Ur:UrObject/>
    <Base:Transient>
      <Base:Inventory/>
    </Base:Transient>
    <Base:Misc gender="neuter" volition="false" weapon="false"
default_stance="none" combinable="false" discrete="false"
by_weight="false" tight="false" scriptrunner="false">
      <Base:Edible value="false"/>
      <Base:Potable value="false"/>
      <Base:DrinkMessageFirst/>
      <Base:DrinkMessageThird/>
      <Base:Transparency value="false"/>
      <Base:Unsafe value="false"/>
      <Base:Safe value="false"/>
      <Base:ClothesExpected value="false"/>
      <Base:DieMessageFirst/>
      <Base:DieMessageThird/>
    </Base:Misc>
    <Base:Details>
      <Base:Detail id="default" prime="true" def="false"
abstract="false" hidden="false" luminosity="0">
        <Base:Preposition close="true" against="true" under="false"
on="true" inside="false" near="true" over="true" behind="true"
before="true" beside="true"/>
        <Base:Names>
          <Base:Name sname="rose" pname="roses"/>
          <Base:Name sname="flower" pname="flowers"/>
        </Base:Names>
        <Base:Adjectives>
          <Base:Adjective adjective="deep"/>
          <Base:Adjective adjective="red"/>
        </Base:Adjectives>
        <Base:Descriptions>
          <Base:Description type="brief">red rose</Base:Description>
          <Base:Description type="examine">
             A rose with deep red petals.
          </Base:Description>
          <Base:Description type="look">
             A deep red rose.
          </Base:Description>
          <Base:Description type="react-post:sense/smell-dob">
             The deep red rose has a rich, rose-scented floral bouquet,
with a slight sweet undertone of musk.
          </Base:Description>
          <Base:Description type="react-post:sense/taste-iob">
             The red rose petals have a somewhat bitter, grassy taste,
with a slightly fruity aftertaste somewhat like a ripe peach. The petals
have a kind of a soft gritty texture and are somewhat succulent.
          </Base:Description>
          <Base:Description type="react-post:sense/touch-dob">
             The stem of the red rose is stiff and has many sharp
thorns, but the petals are velvety soft.
          </Base:Description>
        </Base:Descriptions>
        <Base:Exit door="false" never_obvious="false"
obvious_when_open="false" hidden_when_closed="false" separate="false"
self-locking="false" deadbolt="false"/>
        <Base:Climbable/>
      </Base:Detail>
      <Base:Detail id="petals" prime="false" def="true" abstract="false"
hidden="false" luminosity="0">
        <Base:Preposition close="false" against="false" under="false"
on="false" inside="false" near="true" over="false" behind="false"
before="false" beside="false"/>
        <Base:Names>
          <Base:Name sname="petal" pname="petals"/>
          <Base:Name sname="petals"/>
        </Base:Names>
        <Base:Adjectives>
          <Base:Adjective adjective="deep"/>
          <Base:Adjective adjective="red"/>
          <Base:Adjective adjective="soft"/>
        </Base:Adjectives>
        <Base:Descriptions>
          <Base:Description type="brief">
             the red petals of a rose
          </Base:Description>
          <Base:Description type="look">
             The deep red petals of a rose.
          </Base:Description>
          <Base:Description type="react-post:sense/touch-dob">
             The deep red petals of the rose feel very soft, almost
velvety.
          </Base:Description>
        </Base:Descriptions>
        <Base:Exit door="false" never_obvious="false"
obvious_when_open="false" hidden_when_closed="false" separate="false"
self-locking="false" deadbolt="false"/>
        <Base:Climbable/>
      </Base:Detail>
      <Base:Detail id="stemandthorns" prime="false" def="true"
abstract="false" hidden="false" luminosity="0">
        <Base:Preposition close="false" against="false" under="false"
on="false" inside="false" near="true" over="false" behind="false"
before="false" beside="false"/>
        <Base:Names>
          <Base:Name sname="stem" pname="stems"/>
          <Base:Name sname="thorn" pname="thorns"/>
        </Base:Names>
        <Base:Adjectives>
          <Base:Adjective adjective="deep"/>
          <Base:Adjective adjective="red"/>
          <Base:Adjective adjective="sharp"/>
          <Base:Adjective adjective="stiff"/>
          <Base:Adjective adjective="thorny"/>
        </Base:Adjectives>
        <Base:Descriptions>
          <Base:Description type="brief">
             the thorny stem of a red rose
          </Base:Description>
          <Base:Description type="examine">
             The stem of a deep red a rose, covered in thorns.
          </Base:Description>
          <Base:Description type="look">
             The thorny stem of a rose.
          </Base:Description>
          <Base:Description type="react-post:sense/touch-dob">
             The stem of the rose is stiff and is covered with many
thorns that feel quite sharp.
          </Base:Description>
        </Base:Descriptions>
        <Base:Exit door="false" never_obvious="false"
obvious_when_open="false" hidden_when_closed="false" separate="false"
self-locking="false" deadbolt="false"/>
        <Base:Climbable/>
      </Base:Detail>
    </Base:Details>
    <Base:Bulk immobile="false" flexible="false">
      <Base:Mass value="1"/>
      <Base:Density value="1"/>
      <Base:Capacity value="0"/>
      <Base:MaxWeight value="1"/>
    </Base:Bulk>
    <Base:Combat>
      <Base:Strength value="1"/>
      <Base:MaxFatigue value="1"/>
    </Base:Combat>
    <Base:Clothing>
      <Base:SingleWear value="false"/>
    </Base:Clothing>
    <Base:Crafting see_level="0" do_level="0" time="0" attention="false"
held="false">
      <Base:Ingredients/>
      <Base:Tools/>
      <Base:CraftVerbs/>
    </Base:Crafting>
    <Base:Container>
      <Base:ContainerVerbSecond/>
      <Base:ContainerVerbThird/>
    </Base:Container>
    <Base:InitialContents/>
    <Base:InitialProperties/>
    <Core:Properties>
      <Core:Property property="trait:flower">rose</Core:Property>
    </Core:Properties>
    <Notes:Notes/>
  </Base:Thing>
</object>


_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list