Jump to content

xml parsing


shocker-z

Recommended Posts

Hi all,

 

I was wanting to know how i can parse the name out of this XML

 

Current code attached in txt file as this forum wont let me post it. comes up saying:

Method Not Implemented

POST to /forums/index.php not supported.
Apache/2.2.0 (Linux) Server at www.phpfreaks.com Port 80

 

Code now shown below, what's happening to the forum people as i'm strugling to post new posts and replys with code in.

 

<?php
$xml = '<?xml version="1.0" encoding="UTF-8" ?>
<Report>
    <Student>
      <name value="liam wheldon"/>
      <dob value="22/01/1985"/>
      <srn value="555"/>
      <grn value=""/>
      <mathsGrade value=""/>
      <englishLangGrade value=""/>
      <englishFirstLang value="Not entered"/>
      <otherLangHome value="Not entered"/>
      <otherLangWork value="Not entered"/>
      <otherLangFriends value="Not entered"/>
    </Student>
</Report>';

 

if i change

 

<name value="liam wheldon"/>

 

 

to

 

<name>liam wheldon</name>

 

it will work fine so what do i need to do to change this to get it working as the xml above is a sniplet from XML output by an application which isn't likley to get changed.

 

Regards

Liam

 

 

Link to comment
https://forums.phpfreaks.com/topic/94241-xml-parsing/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.