Jump to content

Using SAX


vho

Recommended Posts

Hi guys i have this small class task that i'm having trouble with. I need to create a PHP file using SAX to generate the display shown below from an XML file.

 

*** This is the xml source code from which i need to generate the display: ***

<orders>
  <order>
    <count>37</count>
    <price>49.99</price>
    <book>
      <isbn>0130897930</isbn>
      <title>Core Web Programming Second Edition</title>

      <authors>
    	  <count>2</count>
        <author>Marty Hall</author>
        <author>Larry Brown</author>
      </authors>
    </book>
  </order>

  <order>
    <count>1</count>
    <price>9.95</price>
    <yacht>
      <manufacturer>Luxury Yachts, Inc.</manufacturer>
      <model>M-1</model>
      <standardFeatures oars="plastic" lifeVests="none">false</standardFeatures>

    </yacht>
  </order>
  <order>
    <count>3</count>
    <price>22.22</price>
    <book>
      <isbn>B000059Z4H</isbn>

      <title>Harry Potter and the Order of the Phoenix</title>
      <authors>
    	  <count>1</count>
        <author>J.K. Rowling</author>
      </authors>
    </book>
  </order>

 

*** what the expected output to look like below. ***

75914446.jpg

Link to comment
https://forums.phpfreaks.com/topic/202029-using-sax/
Share on other sites

Sorry for being vague but what i know is that it will be parsed through a SAX parser which usually generates a sequence of events. I'm having trouble with the php coding as this is my first class. I have tried reading through w3schools but i'm still having trouble understanding it. if u can give me a nudge in the right direction i'll try take it from there.

Link to comment
https://forums.phpfreaks.com/topic/202029-using-sax/#findComment-1059468
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.