advanced xml? multi level .. php parsing

Posted by dave1019 on Stack Overflow See other posts from Stack Overflow or by dave1019
Published on 2010-03-24T11:48:26Z Indexed on 2010/03/24 11:53 UTC
Read the original article Hit count: 463

Filed under:
|
|

hi

my knowledge of xml and php is somewhat basic but have been able to parse a simple xml document (one level) ~

<numbers>
   <number>1</number>
   <number>2</number>
</numbers>

i'm attempting to parse an xml document from a website providing the latest market prices for gold bullion. I think i'm going to need a paid professional but want to give it a shot

the xml file looks like this:

<envelope>
  <message type="MARKET_DEPTH_A" version="0.1">
    <market>
      <pitches>
            <pitch
            securityClassNarrative="GOLD"
            securityId="AUXLN"
            considerationCurrency="GBP"
            >
              <buyPrices>
                    <price
                    actionIndicator="B"
                    quantity="0.153"
                    limit="23477"
              />
          </buyPrices>

          <sellPrices>
                    <price
                    actionIndicator="S"
                    quantity="0.058"
                    limit="23589"
              />
          </sellPrices>

        </pitch>
      </pitches>
    </market>
  </message>
</envelope>

and simply i have no idea how to access the values within the "headings". (whatever the term is)

sounds like i'm asking for someone to do it for me, which I don't want, but I don't know what to search for ~ it doesn't look like a regular xml structure to me.

thanks!

© Stack Overflow or respective owner

Related posts about Xml

Related posts about attributes