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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.