Sign Up! Login: Password: New User? Forgot? Support
Top Mods!
Wowhead Search
by sonofsamedi
Digital Clock
by Wolfar15
Admin Forums
Welcome to the GuildPortal Help Community! These forums are for admin-to-admin help.
Available Forums
Forums : Voodoo Tech and Scripter's Den of Scriptniquity > XSL code to process Magelo XML data (Character inventory)
536985018_Inactive (New Admin) 9/24/2004 1:47 AM EST : XSL code to process Magelo XML data (Character invent...
536985018_Inactive
Posts: 329
Fingers of Fury!

name="3586172">

I wrote this piece of XSL code for my guild.  It takes the XML files that Magelo dumps of a character's inventory, and turns it into tables.

It is setup to display each item only once.  It also generates a total number for each item even if they're in multiple stacks.

I use this in the guild to automatically create a list of the items in the Guild Bank (This character's entire inventory).  This is free for anyone who wishes to use it


<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

 <xsl:template match="/character">
  <div style="background-color:#000000;padding:5">

  I put a note in here on how to retrieve items from the bank by sending a /tell

  <table width="100%" bgcolor="#FFFFFF">
  <tr align="center">
  <td width="25%">Platinum: <xsl:value-of select="money/player/platinum" /></td>
  <td width="25%">Gold: <xsl:value-of select="money/player/gold" /></td>
  <td width="25%">Silver: <xsl:value-of select="money/player/silver" /></td>
  <td width="25%">Copper: <xsl:value-of select="money/player/copper" /></td>
  </tr>
  </table>
  <xsl:apply-templates select="items"/>

 </div>
 </xsl:template>

 <xsl:template match="items">
  <div class="ContentBox">
  <table border="1" width="100%">

  <tr><th>Qty</th><th>Item Name</th><th>Links</th></tr>

  <xsl:for-each select="item">
   <xsl:sort select="@name"/>
   <xsl:if test="
   not(@id=preceding-sibling::item/@id) and
   (
    (@location &gt; 0) and (@location &lt; 10000)
   )
   ">
    <xsl:apply-templates select="."/>
   </xsl:if>
  </xsl:for-each>
  </table>
  </div>
 </xsl:template>

 <xsl:template match="item">
  <tr>

  <xsl:variable name="curname" select="@name"/>
  <td><xsl:value-of select="sum( ../*[$curname=./@name]/@quantity )"/></td>

  <td><xsl:value-of select="@name" /></td>
  <td>
   [<a href="http://lucy.allakhazam.com/item.html?id={@id}">Lucy</a>]

   [<a href="http://www.google.com/search?q=everquest+%22{@name}%22">Google</a>]
  </td>
  </tr>
 </xsl:template>


</xsl:stylesheet>


TopBottom

Admins Online
There are   members online.
So-and-so has logged on!
%title%
%message%