<?xml version= "1.0" encoding= "UTF-8"?> <dict num= "219" id= "219" name= "219" > <key> Sky </key> <pos></pos> <acceptation>Array;Array;</acceptation> <sent> <orig>the church tower stood against the sky like a finger pointing towards The spire of the <trans> church is like a finger pointing to the sky against the backdrop of the sky. </trans> </sent> <sent> <orig>a balloon floated across the sky.</orig> <trans> balloons float across the sky. </trans> </sent> <sent> <orig>a bolt of lightning lit up the sky.</orig> <trans> (a) lightning lights up the sky. </trans> </sent> <sent> <orig>a Bright Moving object appeared in the sky at sunset.</orig> <trans> Sunset, a moving shiny object appeared in the sky. </trans> </sent> <sent> <orig>a Bright Rainbow Arched above.</orig> <trans> a bright rainbow hangs in the sky. </trans> </sent> </dict> in the PHP language we can get the values we want in the following ways: <?php $xmldata = simplexml_load_file ("Iciba.xml"); Header ("content-type:text/html; Charset=utf-8 "); Print_r ($xmldata); The first part www.111cn.net $listcount = count ($xmldata->sent); for ($i =0; $i < $listcount; $i + +) {//Part II $dictlist = $xmldata->sent[$i]; echo "<br/> Example:". $dictlist->orig; echo "<br/> Translation:". $dictlist->trans; } ?> the "first part" will output: SimpleXMLElement Object ( [@attributes] => Array ( [Num] => 219 [ID] => 219 [Name] => 219 ) [Key] => Sky [POS] => simplexmlelement Object ( ) [acceptation] => array;array [sent] => Array ( [0] => SimpleXMLElement Object ( [orig] => the church tower stood against the sky like a finger pointing towards. [Trans] the steeple of the => church is like a finger pointing to the sky against the sky. ) [1] => simplexmlelement Object ( [orig] => A Balloon floated across the sky. [trans] => balloons float across the sky. ) [2] => simplexmlelement Object ( [orig] => A Bolt of lightning lit up the sky. [Trans] => (together) lightning illuminates the sky. ) [3] => simplexmlelement Object ( [orig] => A Bright moving object appeared in the sky at sunset. [Trans] => sunset, a moving shiny object appeared in the sky. ) [4] => simplexmlelement Object ( [orig] => A bright rainbow arched above. [Trans] => a bright rainbow hangs in the sky. ) ) "Part Two" will output: |