I am trying to read multiple xml file from a folder and want to get tag attribute for further processing. So far i have tried many available examples but no luck so far.
below is my code, any help will be appreciated..! Thanks..!
foreach (glob("unzip_temp/other/newfolder/*.xml") as $filename) {
$xml_file = file_get_contents($filename, FILE_TEXT);
$xml = simplexml_load_file($xml_file);
foreach ($xml->tag1 as $fileinfo) {
$name = $fileinfo['Name'];
$language = $fileinfo['Language'];
$creator = $fileinfo['Creator'];
echo "<li> $name ,$language ,$creator";
}
below is the part of xml file that i want to read:
<?xml version="1.0" encoding="utf-16"?>
<tag1 xmlns:xsd="http://ift.tt/tphNwY" xmlns:xsi="http://ift.tt/ra1lAU" Name="Bethanien_Befunder_CTKolon" Language="other" Type="Simple" Creator="ADMINISTRATOR" IsMultiSelect="false" IsFloatingPickList="false" IsPhraseGenerated="false">
No comments:
Post a Comment