kennedypd1
asked on
xml to php
Hi
I am sure this is simple but I have confussed myself I think.
I have the xml file and with a php file I want to have a form that has
Section name
ConstructName
Total
ConstructName
Total
ConstructName
Total
ConstructName
Total
ConstructName
Total
Section name
ConstructName
Total
ConstructName
Total
ConstructName
Total
ConstructName
Total
ConstructName
Total
At the moment I have this php code but it lists all the constructs in the xml file not just the ones inside the section name.
Not sure if this is too clear but ask away if you need more info from me.
Â
PHP CODE
$completeurl ="http://www.pathtoxmlfile";
$xml = simplexml_load_file($compl eteurl);
$testname = $xml->AssessmentDetails->A ssessment;
$testdate = $xml->AssessmentDetails->T imeSubmitt ed;
$testperson = $xml->AssessmentDetails->P erson;
$sectionname = $xml->AssessmentResults->S ection->Se ctionID->S ectionName ;
echo  "$testname";
echo  "$testdate";
echo  "$testperson";
echo "$sectionname";
$constructs = $xml->xpath('/AssessmentRe sult/Asses smentResul ts/Section /SectionCo nstructs/C onstruct') ;
foreach ($xml->AssessmentResults-> Section as $section) {
 echo "<h2>" . $section->SectionName . "</h2>";
foreach ($constructs as $construct) {
 echo "<h3>  {$construct->ConstructName } </h3>";
 echo "<p>  {$construct->Total}  </p>";
}
XML FILE
-<AssessmentResults>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
-<Section>
<SectionID>8</SectionID>
<SectionName>Leadership Dynamics</SectionName>
<IsPositive>positive</IsPo sitive>
-<SectionConstructs>
-<Construct>
<ConstructID>71</Construct ID>
<ConstructName>Leadership Ability</ConstructName>
<IsPositive>positive</IsPo sitive>
<Total>69</Total>
</Construct>
-<Construct>
<ConstructID>73</Construct ID>
<ConstructName>Commitment< /Construct Name>
<IsPositive>positive</IsPo sitive>
<Total>64</Total>
</Construct>
-<Construct>
<ConstructID>77</Construct ID>
<ConstructName>Listening Skills</ConstructName>
<IsPositive>positive</IsPo sitive>
<Total>71</Total>
</Construct>
-<Construct>
<ConstructID>80</Construct ID>
<ConstructName>Problem Solving Ability</ConstructName> <IsPositive>positive</IsPo sitive>
<Total>69</Total>
</Construct>
-<Construct>
<ConstructID>86</Construct ID>
<ConstructName>Interperson al</Constr uctName>
<IsPositive>positive</IsPo sitive>
<Total>66</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>9</SectionID>
<SectionName>Task Orientated Qualities</SectionName>
<IsPositive>positive</IsPo sitive>
-<SectionConstructs>
-<Construct>
<ConstructID>74</Construct ID>
<ConstructName>Communicati on Skills</ConstructName> <IsPositive>positive</IsPo sitive>
<Total>71</Total>
</Construct>
-<Construct>
<ConstructID>78</Construct ID>
<ConstructName>Passion</Co nstructNam e>
<IsPositive>positive</IsPo sitive>
<Total>48</Total>
</Construct>
</SectionConstructs>
</Section>
I am sure this is simple but I have confussed myself I think.
I have the xml file and with a php file I want to have a form that has
Section name
ConstructName
Total
ConstructName
Total
ConstructName
Total
ConstructName
Total
ConstructName
Total
Section name
ConstructName
Total
ConstructName
Total
ConstructName
Total
ConstructName
Total
ConstructName
Total
At the moment I have this php code but it lists all the constructs in the xml file not just the ones inside the section name.
Not sure if this is too clear but ask away if you need more info from me.
Â
PHP CODE
$completeurl ="http://www.pathtoxmlfile";
$xml = simplexml_load_file($compl
$testname = $xml->AssessmentDetails->A
$testdate = $xml->AssessmentDetails->T
$testperson = $xml->AssessmentDetails->P
$sectionname = $xml->AssessmentResults->S
echo  "$testname";
echo  "$testdate";
echo  "$testperson";
echo "$sectionname";
$constructs = $xml->xpath('/AssessmentRe
foreach ($xml->AssessmentResults->
 echo "<h2>" . $section->SectionName . "</h2>";
foreach ($constructs as $construct) {
 echo "<h3>  {$construct->ConstructName
 echo "<p>  {$construct->Total}  </p>";
}
XML FILE
-<AssessmentResults>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
-<Section>
<SectionID>8</SectionID>
<SectionName>Leadership Dynamics</SectionName>
<IsPositive>positive</IsPo
-<SectionConstructs>
-<Construct>
<ConstructID>71</Construct
<ConstructName>Leadership Ability</ConstructName>
<IsPositive>positive</IsPo
<Total>69</Total>
</Construct>
-<Construct>
<ConstructID>73</Construct
<ConstructName>Commitment<
<IsPositive>positive</IsPo
<Total>64</Total>
</Construct>
-<Construct>
<ConstructID>77</Construct
<ConstructName>Listening Skills</ConstructName>
<IsPositive>positive</IsPo
<Total>71</Total>
</Construct>
-<Construct>
<ConstructID>80</Construct
<ConstructName>Problem Solving Ability</ConstructName> <IsPositive>positive</IsPo
<Total>69</Total>
</Construct>
-<Construct>
<ConstructID>86</Construct
<ConstructName>Interperson
<IsPositive>positive</IsPo
<Total>66</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>9</SectionID>
<SectionName>Task Orientated Qualities</SectionName>
<IsPositive>positive</IsPo
-<SectionConstructs>
-<Construct>
<ConstructID>74</Construct
<ConstructName>Communicati
<Total>71</Total>
</Construct>
-<Construct>
<ConstructID>78</Construct
<ConstructName>Passion</Co
<IsPositive>positive</IsPo
<Total>48</Total>
</Construct>
</SectionConstructs>
</Section>
ASKER
Hi
I didnt put the entire xml file up which is what I think you are asking for so here it is.
Hope this is what you are after
<?xml version="1.0" encoding="UTF-8"?>
-<AssessmentResult>
-<AssessmentDetails>
<AssessmentID>2052</Assess mentID>
<Assessment>The Edge</Assessment>
<TimeSubmitted>Mon, 10 Dec 2012. 13:55</TimeSubmitted>
<Person>Mr. Paul P Kennedy</Person>
<Organization>Edge</Organi zation>
</AssessmentDetails>
-<AssessmentResults>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
-<Section>
<SectionID>8</SectionID>
<SectionName>Leadership Dynamics</SectionName>
<IsPositive>positive</IsPo sitive>
-<SectionConstructs>
-<Construct>
<ConstructID>71</Construct ID>
<ConstructName>Leadership Ability</ConstructName>
<IsPositive>positive</IsPo sitive>
<Total>69</Total>
</Construct>
-<Construct>
<ConstructID>73</Construct ID>
<ConstructName>Commitment< /Construct Name>
<IsPositive>positive</IsPo sitive>
<Total>64</Total>
</Construct>
-<Construct>
<ConstructID>77</Construct ID>
<ConstructName>Listening Skills</ConstructName>
<IsPositive>positive</IsPo sitive>
<Total>71</Total>
</Construct>
-<Construct>
<ConstructID>80</Construct ID>
<ConstructName>Problem Solving Ability</ConstructName> <IsPositive>positive</IsPo sitive>
<Total>69</Total>
</Construct>
-<Construct>
<ConstructID>86</Construct ID>
<ConstructName>Interperson al</Constr uctName>
<IsPositive>positive</IsPo sitive>
<Total>66</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>9</SectionID>
<SectionName>Task Orientated Qualities</SectionName>
<IsPositive>positive</IsPo sitive>
-<SectionConstructs>
-<Construct>
<ConstructID>74</Construct ID>
<ConstructName>Communicati on Skills</ConstructName> <IsPositive>positive</IsPo sitive>
<Total>71</Total>
</Construct>
-<Construct>
<ConstructID>78</Construct ID>
<ConstructName>Passion</Co nstructNam e>
<IsPositive>positive</IsPo sitive>
<Total>48</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>10</SectionID>
<SectionName>Self Orientated Qualities</SectionName>
<IsPositive>positive</IsPo sitive>
-<SectionConstructs>
-<Construct>
<ConstructID>82</Construct ID>
<ConstructName>Self - Discipline</ConstructName>
<IsPositive>positive</IsPo sitive>
<Total>56</Total>
</Construct>
-<Construct>
<ConstructID>79</Construct ID>
<ConstructName>Positive Attitude</ConstructName>
<IsPositive>positive</IsPo sitive>
<Total>64</Total>
</Construct>
</SectionConstructs>
</Section>
<Section/>
<Section/>
-<Section>
<SectionID>13</SectionID>
<SectionName>Personal Values</SectionName>
<IsPositive>positive</IsPo sitive>
-<SectionConstructs>
-<Construct>
<ConstructID>49</Construct ID>
<ConstructName>Ability Utilization</ConstructName >
<IsPositive>positive</IsPo sitive>
<Total>90</Total>
</Construct>
-<Construct>
<ConstructID>65</Construct ID>
<ConstructName>Personal Development</ConstructName > <IsPositive>positive</IsPo sitive>
<Total>85</Total>
</Construct>
-<Construct>
<ConstructID>59</Construct ID>
<ConstructName>Personal Standards</ConstructName>
<IsPositive>positive</IsPo sitive>
<Total>71</Total>
</Construct>
-<Construct>
<ConstructID>57</Construct ID>
<ConstructName>Risk</Const ructName>
<IsPositive>positive</IsPo sitive>
<Total>61</Total>
</Construct>
-<Construct>
<ConstructID>47</Construct ID>
<ConstructName>Character Qualities</ConstructName>
<IsPositive>positive</IsPo sitive>
<Total>61</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>14</SectionID>
<SectionName>Money Values</SectionName>
<IsPositive>positive</IsPo sitive>
-<SectionConstructs>
-<Construct>
<ConstructID>58</Construct ID>
<ConstructName>Financial Guarantee</ConstructName>
<IsPositive>positive</IsPo sitive>
<Total>75</Total>
</Construct>
-<Construct>
<ConstructID>54</Construct ID>
<ConstructName>Financial Compensation</ConstructNam e> <IsPositive>positive</IsPo sitive>
 <Total>90</Total>
</Construct>
-<Construct>
<ConstructID>56</Construct ID>
<ConstructName>Status</Con structName >
<IsPositive>positive</IsPo sitive>
<Total>71</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>15</SectionID>
<SectionName>People Values</SectionName>
<IsPositive>positive</IsPo sitive>
-<SectionConstructs>
-<Construct>
<ConstructID>50</Construct ID>
<ConstructName>Interest in People</ConstructName>
<IsPositive>positive</IsPo sitive>
<Total>76</Total>
</Construct>
-<Construct>
<ConstructID>62</Construct ID>
<ConstructName>Social Interaction</ConstructName >
<IsPositive>positive</IsPo sitive>
<Total>56</Total>
</Construct>
-<Construct>
<ConstructID>68</Construct ID>
<ConstructName>Servanthood </Construc tName>
<IsPositive>positive</IsPo sitive>
<Total>57</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>16</SectionID>
<SectionName>Environmental Values</SectionName>
<IsPositive>positive</IsPo sitive>
-<SectionConstructs>
-<Construct>
<ConstructID>55</Construct ID>
<ConstructName>Freedom Of Lifestyle</ConstructName>
<IsPositive>positive</IsPo sitive>
<Total>73</Total>
</Construct>
-<Construct>
<ConstructID>64</Construct ID>
<ConstructName>Predictable Environment</ConstructName > <IsPositive>positive</IsPo sitive>
<Total>64</Total>
</Construct>
-<Construct>
<ConstructID>153</Construc tID>
<ConstructName>Repetitiven ess</Const ructName>
<IsPositive>positive</IsPo sitive>
<Total>41</Total>
</Construct>
-<Construct>
<ConstructID>60</Construct ID>
<ConstructName>Cultural Prejudice</ConstructName>
<IsPositive>positive</IsPo sitive>
<Total>49</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>17</SectionID>
<SectionName>Leadership Values</SectionName>
<IsPositive>positive</IsPo sitive>
-<SectionConstructs>
-<Construct>
<ConstructID>69</Construct ID>
<ConstructName>Result Orientation</ConstructName >
<IsPositive>positive</IsPo sitive>
<Total>72</Total>
</Construct>
-<Construct>
<ConstructID>51</Construct ID>
<ConstructName>Autonomy</C onstructNa me>
<IsPositive>positive</IsPo sitive>
<Total>92</Total>
</Construct>
-<Construct>
<ConstructID>52</Construct ID>
<ConstructName>Authority</ ConstructN ame>
<IsPositive>positive</IsPo sitive>
<Total>83</Total>
</Construct>
-<Construct>
<ConstructID>66</Construct ID>
<ConstructName>Challenging Attributes</ConstructName>
 <IsPositive>positive</IsPo sitive>
<Total>71</Total>
</Construct>
-<Construct>
<ConstructID>67</Construct ID>
<ConstructName>Multi Tasking</ConstructName>
<IsPositive>positive</IsPo sitive>
<Total>52</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>18</SectionID>
<SectionName>Physical Values</SectionName>
<IsPositive>positive</IsPo sitive>
-<SectionConstructs>
-<Construct>
<ConstructID>70</Construct ID>
<ConstructName>Physical Challenges</ConstructName>
<IsPositive>positive</IsPo sitive>
<Total>41</Total>
</Construct>
-<Construct>
<ConstructID>63</Construct ID>
<ConstructName>Physical Activities</ConstructName>
<IsPositive>positive</IsPo sitive>
<Total>49</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>19</SectionID>
<SectionName>Artistic Values</SectionName>
<IsPositive>positive</IsPo sitive>
-<SectionConstructs>
-<Construct>
<ConstructID>61</Construct ID>
<ConstructName>Artistic Appreciation</ConstructNam e>
<IsPositive>positive</IsPo sitive>
<Total>73</Total>
</Construct>
-<Construct>
<ConstructID>53</Construct ID>
<ConstructName>Originality </Construc tName>
<IsPositive>positive</IsPo sitive>
<Total>97</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>20</SectionID>
<SectionName>Fields of Interest</SectionName>
<IsPositive>positive</IsPo sitive>
-<SectionConstructs>
-<Construct>
<ConstructID>116</Construc tID>
<ConstructName>General Culture</ConstructName>
<IsPositive>positive</IsPo sitive>
<Total>38</Total>
</Construct>
-<Construct>
<ConstructID>117</Construc tID>
<ConstructName>Entrepreneu r</Constru ctName>
<IsPositive>positive</IsPo sitive>
<Total>85</Total>
</Construct>
-<Construct>
<ConstructID>118</Construc tID>
<ConstructName>Business Interaction</ConstructName >
<IsPositive>positive</IsPo sitive>
<Total>75</Total>
</Construct>
-<Construct>
<ConstructID>119</Construc tID>
<ConstructName>Technology< /Construct Name>
<IsPositive>positive</IsPo sitive>
<Total>99</Total>
</Construct>
-<Construct>
<ConstructID>130</Construc tID>
<ConstructName>Marketing</ ConstructN ame>
<IsPositive>positive</IsPo sitive>
<Total>87</Total>
</Construct>
-<Construct>
<ConstructID>115</Construc tID>
<ConstructName>Service</Co nstructNam e>
<IsPositive>positive</IsPo sitive>
<Total>49</Total>
</Construct>
-<Construct>
<ConstructID>131</Construc tID>
<ConstructName>Research</C onstructNa me>
<IsPositive>positive</IsPo sitive>
<Total>70</Total>
</Construct>
-<Construct>
<ConstructID>129</Construc tID>
<ConstructName>Aeronautics </Construc tName>
<IsPositive>positive</IsPo sitive>
<Total>45</Total>
</Construct>
-<Construct>
<ConstructID>127</Construc tID>
<ConstructName>Administrat ion</Const ructName>
<IsPositive>positive</IsPo sitive>
<Total>57</Total>
</Construct>
-<Construct>
<ConstructID>126</Construc tID>
<ConstructName>Training</C onstructNa me>
<IsPositive>positive</IsPo sitive>
<Total>75</Total>
</Construct>
-<Construct>
<ConstructID>125</Construc tID>
<ConstructName>Medical</Co nstructNam e>
<IsPositive>positive</IsPo sitive>
<Total>33</Total>
</Construct>
-<Construct>
<ConstructID>124</Construc tID>
<ConstructName>Mechanical< /Construct Name>
<IsPositive>positive</IsPo sitive>
<Total>40</Total>
</Construct>
-<Construct>
<ConstructID>123</Construc tID>
<ConstructName>Entertainme nt</Constr uctName>
<IsPositive>positive</IsPo sitive>
<Total>56</Total>
</Construct>
-<Construct>
<ConstructID>122</Construc tID>
<ConstructName>Arts</Const ructName>
<IsPositive>positive</IsPo sitive>
<Total>83</Total>
</Construct>
-<Construct>
<ConstructID>128</Construc tID>
<ConstructName>Human Resources</ConstructName>
<IsPositive>positive</IsPo sitive>
<Total>68</Total>
</Construct>
-<Construct>
<ConstructID>120</Construc tID>
<ConstructName>Science</Co nstructNam e>
<IsPositive>positive</IsPo sitive>
<Total>66</Total>
</Construct>
-<Construct>
<ConstructID>121</Construc tID>
<ConstructName>Outdoors</C onstructNa me>
<IsPositive>positive</IsPo sitive>
<Total>45</Total>
</Construct>
</SectionConstructs>
</Section>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
</AssessmentResults>
</AssessmentResult>
I didnt put the entire xml file up which is what I think you are asking for so here it is.
Hope this is what you are after
<?xml version="1.0" encoding="UTF-8"?>
-<AssessmentResult>
-<AssessmentDetails>
<AssessmentID>2052</Assess
<Assessment>The Edge</Assessment>
<TimeSubmitted>Mon, 10 Dec 2012. 13:55</TimeSubmitted>
<Person>Mr. Paul P Kennedy</Person>
<Organization>Edge</Organi
</AssessmentDetails>
-<AssessmentResults>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
-<Section>
<SectionID>8</SectionID>
<SectionName>Leadership Dynamics</SectionName>
<IsPositive>positive</IsPo
-<SectionConstructs>
-<Construct>
<ConstructID>71</Construct
<ConstructName>Leadership Ability</ConstructName>
<IsPositive>positive</IsPo
<Total>69</Total>
</Construct>
-<Construct>
<ConstructID>73</Construct
<ConstructName>Commitment<
<IsPositive>positive</IsPo
<Total>64</Total>
</Construct>
-<Construct>
<ConstructID>77</Construct
<ConstructName>Listening Skills</ConstructName>
<IsPositive>positive</IsPo
<Total>71</Total>
</Construct>
-<Construct>
<ConstructID>80</Construct
<ConstructName>Problem Solving Ability</ConstructName> <IsPositive>positive</IsPo
<Total>69</Total>
</Construct>
-<Construct>
<ConstructID>86</Construct
<ConstructName>Interperson
<IsPositive>positive</IsPo
<Total>66</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>9</SectionID>
<SectionName>Task Orientated Qualities</SectionName>
<IsPositive>positive</IsPo
-<SectionConstructs>
-<Construct>
<ConstructID>74</Construct
<ConstructName>Communicati
<Total>71</Total>
</Construct>
-<Construct>
<ConstructID>78</Construct
<ConstructName>Passion</Co
<IsPositive>positive</IsPo
<Total>48</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>10</SectionID>
<SectionName>Self Orientated Qualities</SectionName>
<IsPositive>positive</IsPo
-<SectionConstructs>
-<Construct>
<ConstructID>82</Construct
<ConstructName>Self - Discipline</ConstructName>
<IsPositive>positive</IsPo
<Total>56</Total>
</Construct>
-<Construct>
<ConstructID>79</Construct
<ConstructName>Positive Attitude</ConstructName>
<IsPositive>positive</IsPo
<Total>64</Total>
</Construct>
</SectionConstructs>
</Section>
<Section/>
<Section/>
-<Section>
<SectionID>13</SectionID>
<SectionName>Personal Values</SectionName>
<IsPositive>positive</IsPo
-<SectionConstructs>
-<Construct>
<ConstructID>49</Construct
<ConstructName>Ability Utilization</ConstructName
<IsPositive>positive</IsPo
<Total>90</Total>
</Construct>
-<Construct>
<ConstructID>65</Construct
<ConstructName>Personal Development</ConstructName
<Total>85</Total>
</Construct>
-<Construct>
<ConstructID>59</Construct
<ConstructName>Personal Standards</ConstructName>
<IsPositive>positive</IsPo
<Total>71</Total>
</Construct>
-<Construct>
<ConstructID>57</Construct
<ConstructName>Risk</Const
<IsPositive>positive</IsPo
<Total>61</Total>
</Construct>
-<Construct>
<ConstructID>47</Construct
<ConstructName>Character Qualities</ConstructName>
<IsPositive>positive</IsPo
<Total>61</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>14</SectionID>
<SectionName>Money Values</SectionName>
<IsPositive>positive</IsPo
-<SectionConstructs>
-<Construct>
<ConstructID>58</Construct
<ConstructName>Financial Guarantee</ConstructName>
<IsPositive>positive</IsPo
<Total>75</Total>
</Construct>
-<Construct>
<ConstructID>54</Construct
<ConstructName>Financial Compensation</ConstructNam
 <Total>90</Total>
</Construct>
-<Construct>
<ConstructID>56</Construct
<ConstructName>Status</Con
<IsPositive>positive</IsPo
<Total>71</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>15</SectionID>
<SectionName>People Values</SectionName>
<IsPositive>positive</IsPo
-<SectionConstructs>
-<Construct>
<ConstructID>50</Construct
<ConstructName>Interest in People</ConstructName>
<IsPositive>positive</IsPo
<Total>76</Total>
</Construct>
-<Construct>
<ConstructID>62</Construct
<ConstructName>Social Interaction</ConstructName
<IsPositive>positive</IsPo
<Total>56</Total>
</Construct>
-<Construct>
<ConstructID>68</Construct
<ConstructName>Servanthood
<IsPositive>positive</IsPo
<Total>57</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>16</SectionID>
<SectionName>Environmental
<IsPositive>positive</IsPo
-<SectionConstructs>
-<Construct>
<ConstructID>55</Construct
<ConstructName>Freedom Of Lifestyle</ConstructName>
<IsPositive>positive</IsPo
<Total>73</Total>
</Construct>
-<Construct>
<ConstructID>64</Construct
<ConstructName>Predictable
<Total>64</Total>
</Construct>
-<Construct>
<ConstructID>153</Construc
<ConstructName>Repetitiven
<IsPositive>positive</IsPo
<Total>41</Total>
</Construct>
-<Construct>
<ConstructID>60</Construct
<ConstructName>Cultural Prejudice</ConstructName>
<IsPositive>positive</IsPo
<Total>49</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>17</SectionID>
<SectionName>Leadership Values</SectionName>
<IsPositive>positive</IsPo
-<SectionConstructs>
-<Construct>
<ConstructID>69</Construct
<ConstructName>Result Orientation</ConstructName
<IsPositive>positive</IsPo
<Total>72</Total>
</Construct>
-<Construct>
<ConstructID>51</Construct
<ConstructName>Autonomy</C
<IsPositive>positive</IsPo
<Total>92</Total>
</Construct>
-<Construct>
<ConstructID>52</Construct
<ConstructName>Authority</
<IsPositive>positive</IsPo
<Total>83</Total>
</Construct>
-<Construct>
<ConstructID>66</Construct
<ConstructName>Challenging
 <IsPositive>positive</IsPo
<Total>71</Total>
</Construct>
-<Construct>
<ConstructID>67</Construct
<ConstructName>Multi Tasking</ConstructName>
<IsPositive>positive</IsPo
<Total>52</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>18</SectionID>
<SectionName>Physical Values</SectionName>
<IsPositive>positive</IsPo
-<SectionConstructs>
-<Construct>
<ConstructID>70</Construct
<ConstructName>Physical Challenges</ConstructName>
<IsPositive>positive</IsPo
<Total>41</Total>
</Construct>
-<Construct>
<ConstructID>63</Construct
<ConstructName>Physical Activities</ConstructName>
<IsPositive>positive</IsPo
<Total>49</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>19</SectionID>
<SectionName>Artistic Values</SectionName>
<IsPositive>positive</IsPo
-<SectionConstructs>
-<Construct>
<ConstructID>61</Construct
<ConstructName>Artistic Appreciation</ConstructNam
<IsPositive>positive</IsPo
<Total>73</Total>
</Construct>
-<Construct>
<ConstructID>53</Construct
<ConstructName>Originality
<IsPositive>positive</IsPo
<Total>97</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>20</SectionID>
<SectionName>Fields of Interest</SectionName>
<IsPositive>positive</IsPo
-<SectionConstructs>
-<Construct>
<ConstructID>116</Construc
<ConstructName>General Culture</ConstructName>
<IsPositive>positive</IsPo
<Total>38</Total>
</Construct>
-<Construct>
<ConstructID>117</Construc
<ConstructName>Entrepreneu
<IsPositive>positive</IsPo
<Total>85</Total>
</Construct>
-<Construct>
<ConstructID>118</Construc
<ConstructName>Business Interaction</ConstructName
<IsPositive>positive</IsPo
<Total>75</Total>
</Construct>
-<Construct>
<ConstructID>119</Construc
<ConstructName>Technology<
<IsPositive>positive</IsPo
<Total>99</Total>
</Construct>
-<Construct>
<ConstructID>130</Construc
<ConstructName>Marketing</
<IsPositive>positive</IsPo
<Total>87</Total>
</Construct>
-<Construct>
<ConstructID>115</Construc
<ConstructName>Service</Co
<IsPositive>positive</IsPo
<Total>49</Total>
</Construct>
-<Construct>
<ConstructID>131</Construc
<ConstructName>Research</C
<IsPositive>positive</IsPo
<Total>70</Total>
</Construct>
-<Construct>
<ConstructID>129</Construc
<ConstructName>Aeronautics
<IsPositive>positive</IsPo
<Total>45</Total>
</Construct>
-<Construct>
<ConstructID>127</Construc
<ConstructName>Administrat
<IsPositive>positive</IsPo
<Total>57</Total>
</Construct>
-<Construct>
<ConstructID>126</Construc
<ConstructName>Training</C
<IsPositive>positive</IsPo
<Total>75</Total>
</Construct>
-<Construct>
<ConstructID>125</Construc
<ConstructName>Medical</Co
<IsPositive>positive</IsPo
<Total>33</Total>
</Construct>
-<Construct>
<ConstructID>124</Construc
<ConstructName>Mechanical<
<IsPositive>positive</IsPo
<Total>40</Total>
</Construct>
-<Construct>
<ConstructID>123</Construc
<ConstructName>Entertainme
<IsPositive>positive</IsPo
<Total>56</Total>
</Construct>
-<Construct>
<ConstructID>122</Construc
<ConstructName>Arts</Const
<IsPositive>positive</IsPo
<Total>83</Total>
</Construct>
-<Construct>
<ConstructID>128</Construc
<ConstructName>Human Resources</ConstructName>
<IsPositive>positive</IsPo
<Total>68</Total>
</Construct>
-<Construct>
<ConstructID>120</Construc
<ConstructName>Science</Co
<IsPositive>positive</IsPo
<Total>66</Total>
</Construct>
-<Construct>
<ConstructID>121</Construc
<ConstructName>Outdoors</C
<IsPositive>positive</IsPo
<Total>45</Total>
</Construct>
</SectionConstructs>
</Section>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
</AssessmentResults>
</AssessmentResult>
ASKER
I have shortened the xml file and it is below. Also under that I have the results as I want the php file to display them. Hope this is clearer.
<?xml version="1.0" encoding="UTF-8"?>
-<AssessmentResult>
-<AssessmentDetails>
<AssessmentID>2052</Assess mentID>
<Assessment>The Edge Career Planning Inven</Assessment>
<TimeSubmitted>Mon, 10 Dec 2012. 13:55</TimeSubmitted>
<Person>Mr. Paul P Kennedy</Person>
<Organization>The Edge BT</Organization>
</AssessmentDetails>
-<AssessmentResults>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
-<Section>
<SectionID>8</SectionID>
<SectionName>Leadership Dynamics</SectionName>
<IsPositive>positive</IsPo sitive>
-<SectionConstructs>
-<Construct>
<ConstructID>71</Construct ID>
<ConstructName>Leadership Ability</ConstructName>
<IsPositive>positive</IsPo sitive>
<Total>69</Total>
</Construct>
-<Construct>
<ConstructID>73</Construct ID>
<ConstructName>Commitment< /Construct Name>
<IsPositive>positive</IsPo sitive>
<Total>64</Total>
</Construct>
-<Construct>
<ConstructID>77</Construct ID>
<ConstructName>Listening Skills</ConstructName>
<IsPositive>positive</IsPo sitive>
<Total>71</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>9</SectionID>
<SectionName>Task Orientated Qualities</SectionName>
<IsPositive>positive</IsPo sitive>
-<SectionConstructs>
-<Construct>
<ConstructID>74</Construct ID>
<ConstructName>Communicati on Skills</ConstructName>
<IsPositive>positive</IsPo sitive>
<Total>71</Total>
</Construct>
-<Construct>
<ConstructID>78</Construct ID>
<ConstructName>Passion</Co nstructNam e>
<IsPositive>positive</IsPo sitive>
<Total>48</Total>
</Construct>
</SectionConstructs>
</Section>
</SectionConstructs>
</Section>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
</AssessmentResults>
</AssessmentResult>
Leadership Ability      69
Commitment          64
Listening Skills         71
Communication Skills   71
Passion               48
<?xml version="1.0" encoding="UTF-8"?>
-<AssessmentResult>
-<AssessmentDetails>
<AssessmentID>2052</Assess
<Assessment>The Edge Career Planning Inven</Assessment>
<TimeSubmitted>Mon, 10 Dec 2012. 13:55</TimeSubmitted>
<Person>Mr. Paul P Kennedy</Person>
<Organization>The Edge BT</Organization>
</AssessmentDetails>
-<AssessmentResults>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
-<Section>
<SectionID>8</SectionID>
<SectionName>Leadership Dynamics</SectionName>
<IsPositive>positive</IsPo
-<SectionConstructs>
-<Construct>
<ConstructID>71</Construct
<ConstructName>Leadership Ability</ConstructName>
<IsPositive>positive</IsPo
<Total>69</Total>
</Construct>
-<Construct>
<ConstructID>73</Construct
<ConstructName>Commitment<
<IsPositive>positive</IsPo
<Total>64</Total>
</Construct>
-<Construct>
<ConstructID>77</Construct
<ConstructName>Listening Skills</ConstructName>
<IsPositive>positive</IsPo
<Total>71</Total>
</Construct>
</SectionConstructs>
</Section>
-<Section>
<SectionID>9</SectionID>
<SectionName>Task Orientated Qualities</SectionName>
<IsPositive>positive</IsPo
-<SectionConstructs>
-<Construct>
<ConstructID>74</Construct
<ConstructName>Communicati
<IsPositive>positive</IsPo
<Total>71</Total>
</Construct>
-<Construct>
<ConstructID>78</Construct
<ConstructName>Passion</Co
<IsPositive>positive</IsPo
<Total>48</Total>
</Construct>
</SectionConstructs>
</Section>
</SectionConstructs>
</Section>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
</AssessmentResults>
</AssessmentResult>
Leadership Dynamics
Leadership Ability      69
Commitment          64
Listening Skills         71
Task Orientated Qualities Â
ÂCommunication Skills   71
Passion               48
The most recent XML document will not parse, either. Â I used the larger one in the middle to get this script working. Â
http://www.laprbass.com/RAY_temp_kennedypd1.php
http://www.laprbass.com/RAY_temp_kennedypd1.php
<?php // RAY_temp_kennedypd1.php
error_reporting(E_ALL);
echo '<pre>';
// LOOKING FOR SOMETHING LIKE THIS...
/*
Leadership Dynamics
Leadership Ability 69
Commitment 64
Listening Skills 71
Task Orientated Qualities
Communication Skills 71
Passion 48
*/
$xml = <<<EOD
<?xml version="1.0" encoding="UTF-8"?>
<AssessmentResult>
<AssessmentDetails>
<AssessmentID>2052</AssessmentID>
<Assessment>The Edge</Assessment>
<TimeSubmitted>Mon, 10 Dec 2012. 13:55</TimeSubmitted>
<Person>Mr. Paul P Kennedy</Person>
<Organization>Edge</Organization>
</AssessmentDetails>
<AssessmentResults>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section>
<SectionID>8</SectionID>
<SectionName>Leadership Dynamics</SectionName>
<IsPositive>positive</IsPositive>
<SectionConstructs>
<Construct>
<ConstructID>71</ConstructID>
<ConstructName>Leadership Ability</ConstructName>
<IsPositive>positive</IsPositive>
<Total>69</Total>
</Construct>
<Construct>
<ConstructID>73</ConstructID>
<ConstructName>Commitment</ConstructName>
<IsPositive>positive</IsPositive>
<Total>64</Total>
</Construct>
<Construct>
<ConstructID>77</ConstructID>
<ConstructName>Listening Skills</ConstructName>
<IsPositive>positive</IsPositive>
<Total>71</Total>
</Construct>
<Construct>
<ConstructID>80</ConstructID>
<ConstructName>Problem Solving Ability</ConstructName> <IsPositive>positive</IsPositive>
<Total>69</Total>
</Construct>
<Construct>
<ConstructID>86</ConstructID>
<ConstructName>Interpersonal</ConstructName>
<IsPositive>positive</IsPositive>
<Total>66</Total>
</Construct>
</SectionConstructs>
</Section>
<Section>
<SectionID>9</SectionID>
<SectionName>Task Orientated Qualities</SectionName>
<IsPositive>positive</IsPositive>
<SectionConstructs>
<Construct>
<ConstructID>74</ConstructID>
<ConstructName>Communication Skills</ConstructName> <IsPositive>positive</IsPositive>
<Total>71</Total>
</Construct>
<Construct>
<ConstructID>78</ConstructID>
<ConstructName>Passion</ConstructName>
<IsPositive>positive</IsPositive>
<Total>48</Total>
</Construct>
</SectionConstructs>
</Section>
<Section>
<SectionID>10</SectionID>
<SectionName>Self Orientated Qualities</SectionName>
<IsPositive>positive</IsPositive>
<SectionConstructs>
<Construct>
<ConstructID>82</ConstructID>
<ConstructName>Self - Discipline</ConstructName>
<IsPositive>positive</IsPositive>
<Total>56</Total>
</Construct>
<Construct>
<ConstructID>79</ConstructID>
<ConstructName>Positive Attitude</ConstructName>
<IsPositive>positive</IsPositive>
<Total>64</Total>
</Construct>
</SectionConstructs>
</Section>
<Section/>
<Section/>
<Section>
<SectionID>13</SectionID>
<SectionName>Personal Values</SectionName>
<IsPositive>positive</IsPositive>
<SectionConstructs>
<Construct>
<ConstructID>49</ConstructID>
<ConstructName>Ability Utilization</ConstructName>
<IsPositive>positive</IsPositive>
<Total>90</Total>
</Construct>
<Construct>
<ConstructID>65</ConstructID>
<ConstructName>Personal Development</ConstructName> <IsPositive>positive</IsPositive>
<Total>85</Total>
</Construct>
<Construct>
<ConstructID>59</ConstructID>
<ConstructName>Personal Standards</ConstructName>
<IsPositive>positive</IsPositive>
<Total>71</Total>
</Construct>
<Construct>
<ConstructID>57</ConstructID>
<ConstructName>Risk</ConstructName>
<IsPositive>positive</IsPositive>
<Total>61</Total>
</Construct>
<Construct>
<ConstructID>47</ConstructID>
<ConstructName>Character Qualities</ConstructName>
<IsPositive>positive</IsPositive>
<Total>61</Total>
</Construct>
</SectionConstructs>
</Section>
<Section>
<SectionID>14</SectionID>
<SectionName>Money Values</SectionName>
<IsPositive>positive</IsPositive>
<SectionConstructs>
<Construct>
<ConstructID>58</ConstructID>
<ConstructName>Financial Guarantee</ConstructName>
<IsPositive>positive</IsPositive>
<Total>75</Total>
</Construct>
<Construct>
<ConstructID>54</ConstructID>
<ConstructName>Financial Compensation</ConstructName> <IsPositive>positive</IsPositive>
<Total>90</Total>
</Construct>
<Construct>
<ConstructID>56</ConstructID>
<ConstructName>Status</ConstructName>
<IsPositive>positive</IsPositive>
<Total>71</Total>
</Construct>
</SectionConstructs>
</Section>
<Section>
<SectionID>15</SectionID>
<SectionName>People Values</SectionName>
<IsPositive>positive</IsPositive>
<SectionConstructs>
<Construct>
<ConstructID>50</ConstructID>
<ConstructName>Interest in People</ConstructName>
<IsPositive>positive</IsPositive>
<Total>76</Total>
</Construct>
<Construct>
<ConstructID>62</ConstructID>
<ConstructName>Social Interaction</ConstructName>
<IsPositive>positive</IsPositive>
<Total>56</Total>
</Construct>
<Construct>
<ConstructID>68</ConstructID>
<ConstructName>Servanthood</ConstructName>
<IsPositive>positive</IsPositive>
<Total>57</Total>
</Construct>
</SectionConstructs>
</Section>
<Section>
<SectionID>16</SectionID>
<SectionName>Environmental Values</SectionName>
<IsPositive>positive</IsPositive>
<SectionConstructs>
<Construct>
<ConstructID>55</ConstructID>
<ConstructName>Freedom Of Lifestyle</ConstructName>
<IsPositive>positive</IsPositive>
<Total>73</Total>
</Construct>
<Construct>
<ConstructID>64</ConstructID>
<ConstructName>Predictable Environment</ConstructName> <IsPositive>positive</IsPositive>
<Total>64</Total>
</Construct>
<Construct>
<ConstructID>153</ConstructID>
<ConstructName>Repetitiveness</ConstructName>
<IsPositive>positive</IsPositive>
<Total>41</Total>
</Construct>
<Construct>
<ConstructID>60</ConstructID>
<ConstructName>Cultural Prejudice</ConstructName>
<IsPositive>positive</IsPositive>
<Total>49</Total>
</Construct>
</SectionConstructs>
</Section>
<Section>
<SectionID>17</SectionID>
<SectionName>Leadership Values</SectionName>
<IsPositive>positive</IsPositive>
<SectionConstructs>
<Construct>
<ConstructID>69</ConstructID>
<ConstructName>Result Orientation</ConstructName>
<IsPositive>positive</IsPositive>
<Total>72</Total>
</Construct>
<Construct>
<ConstructID>51</ConstructID>
<ConstructName>Autonomy</ConstructName>
<IsPositive>positive</IsPositive>
<Total>92</Total>
</Construct>
<Construct>
<ConstructID>52</ConstructID>
<ConstructName>Authority</ConstructName>
<IsPositive>positive</IsPositive>
<Total>83</Total>
</Construct>
<Construct>
<ConstructID>66</ConstructID>
<ConstructName>Challenging Attributes</ConstructName>
<IsPositive>positive</IsPositive>
<Total>71</Total>
</Construct>
<Construct>
<ConstructID>67</ConstructID>
<ConstructName>Multi Tasking</ConstructName>
<IsPositive>positive</IsPositive>
<Total>52</Total>
</Construct>
</SectionConstructs>
</Section>
<Section>
<SectionID>18</SectionID>
<SectionName>Physical Values</SectionName>
<IsPositive>positive</IsPositive>
<SectionConstructs>
<Construct>
<ConstructID>70</ConstructID>
<ConstructName>Physical Challenges</ConstructName>
<IsPositive>positive</IsPositive>
<Total>41</Total>
</Construct>
<Construct>
<ConstructID>63</ConstructID>
<ConstructName>Physical Activities</ConstructName>
<IsPositive>positive</IsPositive>
<Total>49</Total>
</Construct>
</SectionConstructs>
</Section>
<Section>
<SectionID>19</SectionID>
<SectionName>Artistic Values</SectionName>
<IsPositive>positive</IsPositive>
<SectionConstructs>
<Construct>
<ConstructID>61</ConstructID>
<ConstructName>Artistic Appreciation</ConstructName>
<IsPositive>positive</IsPositive>
<Total>73</Total>
</Construct>
<Construct>
<ConstructID>53</ConstructID>
<ConstructName>Originality</ConstructName>
<IsPositive>positive</IsPositive>
<Total>97</Total>
</Construct>
</SectionConstructs>
</Section>
<Section>
<SectionID>20</SectionID>
<SectionName>Fields of Interest</SectionName>
<IsPositive>positive</IsPositive>
<SectionConstructs>
<Construct>
<ConstructID>116</ConstructID>
<ConstructName>General Culture</ConstructName>
<IsPositive>positive</IsPositive>
<Total>38</Total>
</Construct>
<Construct>
<ConstructID>117</ConstructID>
<ConstructName>Entrepreneur</ConstructName>
<IsPositive>positive</IsPositive>
<Total>85</Total>
</Construct>
<Construct>
<ConstructID>118</ConstructID>
<ConstructName>Business Interaction</ConstructName>
<IsPositive>positive</IsPositive>
<Total>75</Total>
</Construct>
<Construct>
<ConstructID>119</ConstructID>
<ConstructName>Technology</ConstructName>
<IsPositive>positive</IsPositive>
<Total>99</Total>
</Construct>
<Construct>
<ConstructID>130</ConstructID>
<ConstructName>Marketing</ConstructName>
<IsPositive>positive</IsPositive>
<Total>87</Total>
</Construct>
<Construct>
<ConstructID>115</ConstructID>
<ConstructName>Service</ConstructName>
<IsPositive>positive</IsPositive>
<Total>49</Total>
</Construct>
<Construct>
<ConstructID>131</ConstructID>
<ConstructName>Research</ConstructName>
<IsPositive>positive</IsPositive>
<Total>70</Total>
</Construct>
<Construct>
<ConstructID>129</ConstructID>
<ConstructName>Aeronautics</ConstructName>
<IsPositive>positive</IsPositive>
<Total>45</Total>
</Construct>
<Construct>
<ConstructID>127</ConstructID>
<ConstructName>Administration</ConstructName>
<IsPositive>positive</IsPositive>
<Total>57</Total>
</Construct>
<Construct>
<ConstructID>126</ConstructID>
<ConstructName>Training</ConstructName>
<IsPositive>positive</IsPositive>
<Total>75</Total>
</Construct>
<Construct>
<ConstructID>125</ConstructID>
<ConstructName>Medical</ConstructName>
<IsPositive>positive</IsPositive>
<Total>33</Total>
</Construct>
<Construct>
<ConstructID>124</ConstructID>
<ConstructName>Mechanical</ConstructName>
<IsPositive>positive</IsPositive>
<Total>40</Total>
</Construct>
<Construct>
<ConstructID>123</ConstructID>
<ConstructName>Entertainment</ConstructName>
<IsPositive>positive</IsPositive>
<Total>56</Total>
</Construct>
<Construct>
<ConstructID>122</ConstructID>
<ConstructName>Arts</ConstructName>
<IsPositive>positive</IsPositive>
<Total>83</Total>
</Construct>
<Construct>
<ConstructID>128</ConstructID>
<ConstructName>Human Resources</ConstructName>
<IsPositive>positive</IsPositive>
<Total>68</Total>
</Construct>
<Construct>
<ConstructID>120</ConstructID>
<ConstructName>Science</ConstructName>
<IsPositive>positive</IsPositive>
<Total>66</Total>
</Construct>
<Construct>
<ConstructID>121</ConstructID>
<ConstructName>Outdoors</ConstructName>
<IsPositive>positive</IsPositive>
<Total>45</Total>
</Construct>
</SectionConstructs>
</Section>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
<Section/>
</AssessmentResults>
</AssessmentResult>
EOD;
// MAKE AN OBJECT FROM THE XML
$obj = simpleXML_Load_String($xml);
// ITERATE OVER THE ELEMENTS IN THE OBJECT
foreach ($obj->AssessmentResults->Section as $section)
{
// SOME OF THESE ARE EMPTY
if (!empty($section->SectionName))
{
echo '<h3>' . $section->SectionName. '</h3>';
foreach ($section->SectionConstructs->Construct as $construct)
{
echo $construct->ConstructName;
echo ' ';
echo $construct->Total;
echo PHP_EOL;
}
echo PHP_EOL;
}
}
HTH, ~Ray
ASKER
Hi Ray
Thank you very much for your assistance here.
I have used your code but have not been able to get it to work.
I believe it is the <<<EOD that I need to insert into my code but have no idea how and why. I am pasting mu code here but just to let you know I have put an invalid url to the xml file as I dont want this out there in the public domain. If you need the correct one could we deal with it through email or something. mine is paul@iqit.co.nz
Also this is only a small part of a much bigger picture and I might be in slightly over my head. Do you do contract work and if so would you be interested in looking at this job and working with me.
Cheers
Paul
<?php
error_reporting(E_ALL);
echo '<pre>';
$completeurl ="http://www.functionalintelligence.com/index.jsp?pg=-544&login=1&user=Glentapara1&passw=VwPX85&getxml=true&reportId=2052";
$xml = simplexml_load_file($compl eteurl);
// MAKE AN OBJECT FROM THE XML
$obj = simpleXML_Load_String($xml );
// ITERATE OVER THE ELEMENTS IN THE OBJECT
foreach ($obj->AssessmentResults-> Section as $section)
{
  // SOME OF THESE ARE EMPTY
  if (!empty($section->SectionN ame))
  {
    echo '<h3>' . $section->SectionName. '</h3>';
    foreach ($section->SectionConstruc ts->Constr uct as $construct)
    {
      echo $construct->ConstructName;
      echo ' ';
      echo $construct->Total;
      echo PHP_EOL;
    }
    echo PHP_EOL;
  }
}
?>
Thank you very much for your assistance here.
I have used your code but have not been able to get it to work.
I believe it is the <<<EOD that I need to insert into my code but have no idea how and why. I am pasting mu code here but just to let you know I have put an invalid url to the xml file as I dont want this out there in the public domain. If you need the correct one could we deal with it through email or something. mine is paul@iqit.co.nz
Also this is only a small part of a much bigger picture and I might be in slightly over my head. Do you do contract work and if so would you be interested in looking at this job and working with me.
Cheers
Paul
<?php
error_reporting(E_ALL);
echo '<pre>';
$completeurl ="http://www.functionalintelligence.com/index.jsp?pg=-544&login=1&user=Glentapara1&passw=VwPX85&getxml=true&reportId=2052";
$xml = simplexml_load_file($compl
// MAKE AN OBJECT FROM THE XML
$obj = simpleXML_Load_String($xml
// ITERATE OVER THE ELEMENTS IN THE OBJECT
foreach ($obj->AssessmentResults->
{
  // SOME OF THESE ARE EMPTY
  if (!empty($section->SectionN
  {
    echo '<h3>' . $section->SectionName. '</h3>';
    foreach ($section->SectionConstruc
    {
      echo $construct->ConstructName;
      echo ' ';
      echo $construct->Total;
      echo PHP_EOL;
    }
    echo PHP_EOL;
  }
}
?>
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Open in new window
Please post back with a good test case, thanks, ~Ray