So I guess I'll work on figuring this out, but I need some help. I've worked out more than a few things from the DTD and how to present them but there are some things I can't seem to get working and I'm wondering if anyone here might be able to help me with it.
I'll start off with trying to display Magic Items. I used the Gear entries to make this sort of work as a comma separated list.
First off the lines telling it to display look like:
Quote:
<!-- Magical gear -->
<p class="magicitem">
<xsl:apply-templates select="magicitems/magicitem"/>
</p>
|
Next the template that tells it how to display:
Quote:
<!-- Add a comma before all magic items but the first -->
<xsl:template match="magicitems/magicitem">
<xsl:if test="position() != 1">
<xsl:text>, </xsl:text>
</xsl:if>
<!-- Display the name and quantity - note the lack of newlines / indents
here which make it ugly, but are require to avoid introducing extra
white space which makes the output look bad -->
<xsl:value-of select="@name"/>: <xsl:value-of select="@description"/>, <xsl:value-of select="@enchantments"/><xsl:if test="@quantity != 1">
(x<xsl:value-of select="@quantity"/>)</xsl:if></xsl:template>
|
Again most of that is a direct copy from the sample statblock.xsl file. What I get for output looks like:
Quote:
Armbands of Strength: , , Cloak of Shadows: , , Goggles of the Eagle: , , Griffin Statuette: , , Handy Haversack: , , Thieve's Picks: ,
|
So no real description or enchantments print out.
So from the DTD I can see that there is an ELEMENT entry for "magicitems" with a parenthetical list that includes "magicitem*" in it. Later there is another ELEMENT for "magicitem" with another parenthetical list that includes"description", for example. So it seems that description would not be an @description item, but something different and I don't see any good examples of stuff that is nested 3 deep instead of only 1 or 2 deep. Any ideas?