Jump to content

Parsing XML with SimpleXML


mtorbin

Recommended Posts

Hey folks,

 

I have xml similar to the following:

<masterNode>
  <node>
    <group>
      <item>
        <attribute01></attribute01>
        <attribute02></attribute02>
        <attribute03></attribute03>
        <attribute04></attribute04>
        <attribute05></attribute05>
        <attribute06></attribute06>
      </item>
      <item>
        <attribute01></attribute01>
        <attribute02></attribute02>
        <attribute03></attribute03>
        <attribute04></attribute04>
        <attribute05></attribute05>
        <attribute06></attribute06>
      </item>
      <item>
        <attribute01></attribute01>
        <attribute02></attribute02>
        <attribute03></attribute03>
        <attribute04></attribute04>
        <attribute05></attribute05>
        <attribute06></attribute06>
      </item>
    <group>
  </node>
</masterNode>

 

I'd like to create a loop that says "for each <item> found..." but I'm not sure what syntax to use.  Is this an xPath  issue or something else?  Suggestions are much appreciated.

 

Thanks,

 

- MT

Link to comment
https://forums.phpfreaks.com/topic/138059-parsing-xml-with-simplexml/
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.