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