U
Uncle Sick(tm)
Guest
Anyone knows a good link or could write a short, comprehendible guide?
Uncle Sick would be grateful
Uncle Sick would be grateful
<html>
<link rel="stylesheet" href="../guild/Styles.css" type="text/css">
<body bgcolor="#40008C">
<?
//Open XML File into the DOM
$xmlDom = domxml_open_file("http://www.camelot-europe.com/herald/nb_connected.xml");
//Load XSL Template
$xslDom = domxml_xslt_stylesheet_file("nb_connected.xsl");
//Process the two
$result = $xslDom->process($xmlDom);
//Print the results
print($result->dump_mem(true));
?>
</body>
</html>
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xslutput method="html" version="4.0" encoding="iso-8859-1"/>
<xsl:template match="/">
<xsl:for-each select="/server_status/server">
<table>
<tr>
<td style="color:#AAAAAA;">Name:</td>
<td><xsl:value-of select="@name"/> (<xsl:value-of select="@type"/>)</td>
</tr>
<tr>
<td style="color:#AAAAAA;">Population:</td>
<td><xsl:value-of select="population"/></td>
</tr>
<tr>
<td style="color:#AAAAAA;">Status:</td>
<td>
<xsl:choose>
<xsl:when test="status = 'Up'"><font color="green">Up and ready for action!</font></xsl:when>
<xsltherwise><font color="red">He's dead jim.</font></xsltherwise>
</xsl:choose>
</td>
</tr>
</table>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
<xml id="data" src="http://www.camelot-europe.com/herald/servers/Prydwen/guilds/150.xml"></xml>
<span style="background: white;
width:150; border-width:1" dataSrc="#data"
dataFld="name"></span>
Cadire if your going to take the data binding route you should know its only supported in IE5.5+ and has a lot of security issues involved with doing things client side. Its also pretty limited.
So it will run without modification on the most basic implementation of PHP, even an obsolete one, without needing any special mods, libraries or a database engine.Originally posted by Gef
He has written his own parser for starters, I read that before and couldnt understand why.
I have not posted any more on this thread because you have pretty much taken it over with your posts which are so aggressively evangelical about using an XSL stylesheet that you seem to believe it's the only way to use XML data and any other solution is stupid. I learned a long time ago that there's no arguing with people who think that way, but I will share this opinion with you: a good programmer will write code to do what you need that runs on the system you have available, while a poor programmer will suggest the only technique he knows, and if it won't work the first time he'll say, "your a bit buggered and I would find a new ISP".50% of that code could be done in one or two lines. If you want to learn how XML works dont follow that as a guideline.
Originally posted by Alrindel
So it will run without modification on the most basic implementation of PHP, even an obsolete one, without needing any special mods, libraries or a database engine.
Originally posted by Alrindel
I have not posted any more on this thread because you have pretty much taken it over with your posts which are so aggressively evangelical about using an XSL stylesheet that you seem to believe it's the only way to use XML data and any other solution is stupid. I learned a long time ago that there's no arguing with people who think that way, but I will share this opinion with you: a good programmer will write code to do what you need that runs on the system you have available, while a poor programmer will suggest the only technique he knows, and if it won't work the first time he'll say, "your a bit buggered and I would find a new ISP".
50% of that code could be done in one or two lines. If you want to learn how XML works dont follow that as a guideline.
Originally posted by Gef
I saw one the other day, purpledragons or something, huge ammount of code to do something relatively simple. But if you cant get XSL working on your server its an option.
Define "good programmer". We all think differently, sorry if i dont match your criteria. And for crying out loud, this is a script for sorting a list of characters in a video game, so this sort of criticism is a bit over the top of you ask me.A good programmer would see the value of XML and learn to use it properly rather than bodging something together.
Originally posted by candour
Anyone have a solution/workaround to this? I'm using PHP.
Anyone have a solution/workaround to this? I'm using PHP. I thought of running through the file char by char and verifying the ASCII value, but that doesn't work on gt/lt chars. The only thing I can think of is writing my own XML parser but that seems like a lot of effort for not much reward. Ideally GOA would just delete all guilds/chars with stupid names. Better still, delete their accounts, that'll teach em. [/B]