Jump to content

XML Reader


_spaz

Recommended Posts

Can someone please help me parse this XML structure with XMLReader?  I'm having issues with the proper syntax i think?  XML structure is:

 

<Metadata>

<App_Data App="MOD" Name="Title_Brief" Value="Test"/>

<App_Data App="MOD" Name="Title" Value="Test12"/>

<App_Data App="MOD" Name="Type" Value="title"/>

</Metadata

 

PHP code:

 

reader = new XMLReader();

$reader->open($xmlfile);

 

while ($reader->read()) {

switch ($reader->nodeType) {

  case (XMLREADER::ELEMENT):

 

if ($reader->Name == "Title")

    {

      $reader->read();

      $Title = trim($reader->value);

  echo $Title;

    }

 

Link to comment
https://forums.phpfreaks.com/topic/195376-xml-reader/
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.