transform RDF to HTML via XSL and PHP
| From: | Mario Pavlov | Date: | Sun, 11 Jun 2006 12:14:58 +0000 |
| Subject: | transform RDF to HTML via XSL and PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-237757@lists.php.net to get a copy of this message | ||
Hello :)
I wish to add the FreeBSD news in my site
but I can't transform the RDF document:
http://www.freebsd.org/news/news.rdf
I have a little knowledge in XML XSL but it seems that isn't enough :)
here is my XSL script:
=======================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<xsl:output method='html' version='1.0' encoding='UTF-8'
indent='yes'/>
<xsl:template match="/">
<html>
<body>
<table border="1">
<xsl:for-each select="//rdf:RDF/item">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="link"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
/======================================================================
why doesn't this work ?
it outputs this:
=======================================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><table border="1"></table></body></html>
/======================================================================
I believe that my mistake is in the '<xsl:for-each
select="//rdf:RDF/item">' tag
I've tried also '//rdf:item', '/rdf:item', 'rdf:item',
'/rdf:RDF/item', 'rdf:RDF/item' but with the same result
how can I catch this ?
can anyone help me please ?
thank you :)
-----------------------------------------------------------------
http://www.sportni.bg/worldcup/ - Германия
2006 - Световното първенство по футбол наближава!