Bonjour/Bonsoir à tous et toutes !
Voilà je veux lire certaines données d'un fichier rdf, mais je bloque, si quelqu'un pouvait m'aider svp !
Fichier rdf :
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:rdf="
http://www.w3.org/1999/02/22-rdf-syntax-ns# "
xmlns="
http://purl.org/rss/1.0/ "
xmlns:content="
http://purl.org/rss/1.0/modules/content/ "
xmlns:taxo="
http://purl.org/rss/1.0/modules/taxonomy/ "
xmlns:dc="
http://purl.org/dc/elements/1.1/ "
xmlns:syn="
http://purl.org/rss/1.0/modules/syndication/ "
xmlns:admin="
http://webns.net/mvcb/ "
>
<title>PHPCS.com</title>
<link>
http://www.phpcs.com</link>
<description>Le site reference</description>
<dc:creator>Nom auteur</dc:creator>
<dc:date>2007-03-16T18:53:17Z</dc:date>
<dc:subject>php code</dc:subject>
<taxo:topics>
<rdf:Bag>
<rdf:li resource="
http://www.phpcs.com/tag/php " />
<rdf:li resource="
http://www.phpcs.com/tag/code " />
</rdf:Bag>
</taxo:topics>
</rdf:RDF>
Voici mon code php :
<?php
$fichier = "file.rdf";
$xml = simplexml_load_file($fichier);
echo '<ol>',"\n";
foreach($xml->item as $item) {
echo '<li>',$item->title,"</li> \n";
echo '<li>',$item->link,"</li> \n";
}
echo '</ol>',"\n";
?>
Avec ce code, je peux afficher le titre et le lien.
Mais je cherche comment afficher la valeur "dc:creator" et les données "rdf:li resource". Si quelqu'un sait comment faire merci de m'aider, en vous remerciant d'avance.
Afficher la suite