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...
Posts: 329
Fingers of Fury!


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="" 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>
  <xsl:apply-templates select="items"/>


 <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:template match="item">

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

  <td><xsl:value-of select="@name" /></td>
   [<a href="{@id}">Lucy</a>]

   [<a href="{@name}%22">Google</a>]



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