Xml

Appollo

Part of the furniture
Joined
Dec 22, 2003
Messages
1,651
I wanna play with it but got no idea how, anyone got time 2 help me with it?
 

Killswitch

FH is my second home
Joined
Jan 29, 2004
Messages
1,584
If you're comfortable with web technologies and programming then look at this first;

http://www.zend.com/zend/art/parsing.php

then look at this;

http://news-daoc.goa.com/DAoCbook_xml_main.php3?id_rubrique=179

The first is an article written by Zend on how to parse XML data using PHP. The second is a link to GOAs XML information which will give you the structure of the XML files and allow you to parse it correctly.

If you're less comfortable (or a total noob) then I'd start with the Purple Dragons XML parser for DAOC and play with that first before you start writing from the ground up.

http://www.purpledragons.net/xml/daoc/eu/

Hope that helps. I'm about to start work on a database-powered XML parser and logger for my guild. Hoping to track level changes, RPs etc. and log them to make pretty graphs of how fast people are levelling and stuff like that :)
 

crispy

Can't get enough of FH
Joined
Mar 9, 2004
Messages
2,706
Well ive played around with it a bit. Learned what i know from www.w3schools.com

But i got one problem!

I made this xml file - works fine - then i associated it with an xsl file and and made firefox display the generated xhtml page (thats how it works when i op the xml file in firefox right? :p). Well the page looked how i tohught it should look, but when i opened it in iexplorer it was all messy ;< Think the problem is i need a 'real' xml parser or what ever to convert the xml/xsl file to a xhml page on the server right? And how do i do that? Easiest ofc :D
 

crispy

Can't get enough of FH
Joined
Mar 9, 2004
Messages
2,706
the xml:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="kalender.xsl"?>

<kalender>

  <event>
   <event_navn>Fredagsbar</event_navn>
   <dag_nummer>01</dag_nummer>
   <maaned_nummer>02</maaned_nummer>
   <aar_nummer>2005</aar_nummer>
   <kommentar>tes</kommentar>
  </event>

  <event>
   <event_navn>Fredagsbar</event_navn>
   <dag_nummer>02</dag_nummer>
   <maaned_nummer>03</maaned_nummer>
   <aar_nummer>2002</aar_nummer>
   <kommentar>tas</kommentar>
  </event>

  <event>
   <event_navn>Fredagsbar</event_navn>
   <dag_nummer>04</dag_nummer>
   <maaned_nummer>05</maaned_nummer>
   <aar_nummer>2001</aar_nummer>
   <kommentar>tos</kommentar>
  </event>

  <event>
   <event_navn>Fredagsbar</event_navn>
   <dag_nummer>02</dag_nummer>
   <maaned_nummer>05</maaned_nummer>
   <aar_nummer>2006</aar_nummer>
   <kommentar>tis</kommentar>
  </event>

  <event>
   <event_navn>Fredagsbar</event_navn>
   <dag_nummer>02</dag_nummer>
   <maaned_nummer>04</maaned_nummer>
   <aar_nummer>2006</aar_nummer>
   <kommentar>tus</kommentar>
  </event>

  <event>
   <event_navn>Fressssssssssssssssssssssssssssssssssssssssssdagsbar</event_navn>
   <dag_nummer>03</dag_nummer>
   <maaned_nummer>04</maaned_nummer>
   <aar_nummer>2006</aar_nummer>
   <kommentar>tusssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss</kommentar>
  </event>

</kalender>

the xls:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

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

<xsl:template match="/">
  <html>
  <body>
    <h2 align="center">Velkommen til @lkymias hjemmeside. På siden her kan du finde information om vores arrangementer og se billeder taget ved forskellige lejligheder.</h2>
    <table width="550px" frame="border" rules="rows" cellpadding="2" align="center">
    <tr>
      <th align="center">Dato</th>
      <th align="left">Arrangement</th>
      <th align="left"></th>
    </tr>
    <xsl:for-each select="kalender/event">
    <xsl:sort select="aar_nummer"/>
    <xsl:sort select="maaned_nummer"/>
    <xsl:sort select="dag_nummer"/>
    <tr>
      <td align="center" width="100px"><xsl:value-of select="dag_nummer"/>-<xsl:value-of select="maaned_nummer"/>-<xsl:value-of select="aar_nummer"/></td>
      <td align="left" width="150px"><xsl:value-of select="event_navn"/></td>
      <td align="left" width="300px"><xsl:value-of select="kommentar"/></td>
    </tr>
    </xsl:for-each>
    </table>
  </body>
  </html>
</xsl:template>

</xsl:stylesheet>

im the the best at this web page stuff, just helping manage a web site for some people (got very little knowledge about this :p just writing random stuff that happen to work so excuse me if its crappy code :D)

Its supposed to be a calendar.
 

Takhasis

Can't get enough of FH
Joined
Dec 23, 2003
Messages
1,078
I got PHP code written that will do realm-status for keeps/towers and charinfo for signatures and membership pages.

PM me and i'll send u a copy.

http://www.whoodoo.org/stats/members.php

http://www.whoodoo.org/stats/realm.php (still working on this - works on localhost on my machine but still bugs on internet site)

(example of above working)

http://www.whoodoo.org/stats/images/status.jpg

...and of course, my gfx sigs - customisable for any jpg, any char, any euro server, any guild...

http://www.whoodoo.org/charlogo/cha...Takhasis+DragonSlayer&txtcol=L&srvr=Excalibur
 

Appollo

Part of the furniture
Joined
Dec 22, 2003
Messages
1,651
Its abit more complex than i thought :(
 

Users who are viewing this thread

Top Bottom