[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

SimpleXML and adding nodes to this schema

Asked by EddieShipman in PHP Scripting Language

Tags: simplexml, add

I have the following XML file and need to be able to append new game nodes to
each of the division nodes. I can't figure out how to add to a specific division node
based on the name attribute. Is is also possible to preserve the whitespace in the
XML Data as shown below ?

Example1 does not show me how to tell which division node to append to.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
Example1:
$child = $xml->addChild('element_name', 'element value goes here');
 
The XML data:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
 <data>
   <division name="Austin">
     <game date="Wednesday, Apr 11" 
           home="Royals" hscore="5" hwins="0" hlosses="3" hties="0"
           visitor="Devil Rays" vscore="16" vwins="2 vlosses="0 vties="1" />
     <game date="Saturday, Apr 14" 
           home="Nationals" hscore="ppd" hwins="1" hlosses="0" hties="1"
           visitor="Royals" vscore="rain" vwins="0 vlosses="3 vties="0" />
   </division>
   <division name="Capitol">
     <game date="Monday, Apr 9" 
           home="Tigers" hscore="4" hwins="0" hlosses="2" hties="0"
           visitor="Orioles" vscore="12" vwins="1 vlosses="1 vties="0" />
     <game date="Monday, Apr 9" 
           home="Cardinals" hscore="9" hwins="3" hlosses="0" hties="0"
           visitor="Brewers" vscore="3" vwins="0 vlosses="2 vties="0" />
   </division>
   <division name="Lone Star">
     <game date="Wednesday, Apr 11" 
           home="Curve" hscore="19" hwins="2" hlosses="0" hties="0"
           visitor="Pirates" vscore="6" vwins="1 vlosses="1 vties="0" />
   </division>
   <division name="MABL">
     <game date="Tuesday, Apr 10" 
           home="Legends" hscore="0" hwins="0" hlosses="2" hties="0"
           visitor="Isotopes" vscore="7" vwins="3 vlosses="0 vties="0" />
     <game date="Tuesday, Apr 10" 
           home="Black Sox" hscore="11" hwins="0" hlosses="3" hties="0"
           visitor="Bandits" vscore="15" vwins="2 vlosses="0 vties="0" />
   </division>
   <division name="Texas">
     <game date="Wednesday, Apr 11" 
           home="Diamondbacks" hscore="14" hwins="1" hlosses="1" hties="0"
           visitor="Padres" vscore="11" vwins="0 vlosses="2 vties="0" />
   </division>
 </data>
[+][-]12/04/07 04:16 PM, ID: 20407994Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: PHP Scripting Language
Tags: simplexml, add
Sign Up Now!
Solution Provided By: EddieShipman
Participating Experts: 2
Solution Grade: B
 
[+][-]12/02/07 02:33 AM, ID: 20390763Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/02/07 06:28 AM, ID: 20391105Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/03/07 06:54 AM, ID: 20395729Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/05/07 07:58 AM, ID: 20412288Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93 / EE_QW_EXPERT_20070906