Bonjour,
J'essaie de récupérer des valeurs dans un document tableur de Google Drive.
Je génère pour cela un fichier XML du Graph souhaité ce qui donne ce bout de code qui suit :
Je souhaiterais savoir si avec une requête du type
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 <item> <guid isPermaLink='false'>https://spreadsheets.google.com/feeds/cells/blablablablablaba/od2/public/basic/R2C2</guid> <atom:updated>2014-03-21T16:34:07.662Z</atom:updated> <category domain='http://schemas.google.com/spreadsheets/2006'>http://schemas.google.com/spreadsheets/2006#cell</category> <title>B2</title> <description>219</description> </item> <item> <guid isPermaLink='false'>https://spreadsheets.google.com/feeds/cells/blablablablablaba/od2/public/basic/R4C3</guid> <atom:updated>2014-03-21T16:34:07.662Z</atom:updated> <category domain='http://schemas.google.com/spreadsheets/2006'>http://schemas.google.com/spreadsheets/2006#cell</category> <title>C4</title> <description>115</description> </item>
Code php : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 $fichier = file_get_contents('docxml.xml'); $xml = new SimpleXMLElement($fichier); $xml->registerXPathNamespace('c', 'http://schemas.google.com/spreadsheets/2006'); $Coord = $xml->xpath('//c:title[C4]?description??'); echo $valeur[0] . "\n";
Ou bien entendu on irait récupérer la valeur description en recherchant la valeur title "frère" (ici C4).
Merci d'avance si vous avez des pistes.
Partager