Xml

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • outofmymind
    New Member
    • Oct 2006
    • 45

    Xml

    Hey,

    I came across this question, this is the 1st time I write a XML file, and I have no idea if my work is correct, or if thats how its supposed to be.......please give me your feedback:

    Consider the following XML file that describes a pizza:
    An order for a Pizza in a restaurant, stores the name, address, and the phone number of the customer. It stores also the description of one or more pizzas. A pizza has a size (small priced at $10, medium at $13 and large at $16), a crust type (thin or thick) and one or more toppings. The toping could be meat (beef or chicken), vegetable (red onion or cilantro).

    Create an XML file that describes two different order for two different pizza.


    this is what i did:

    Code:
    <?xml version = ”1.0” ?>
    <Pizza>
    <name> My Pizza </name>
    <address> Kitchen </address>
    <phoneNumber> 065432198 </phoneNumber>
    <description> 
    <size> small </size>
    <price> $10 </price>
    <crust> thin </crust>
    <topping>
    <meat>beef </meat>
    <meat>chicken</meat>
    <vegetable> red onion </vegetable>
    <vegetable> cilantro </vegetable>
    </topping>
    </description>
    <name> His Pizza </name>
    <address> Kitchen2 </address>
    <phoneNumber> 0625678800 </phoneNumber>
    <description> 
    <size> large </size>
    <price> $16 </price>
    <crust> thick </price>
    <topping>
    <meat>beef </meat>
    <meat>chicken<meat>
    <vegetable> red onion </vegetable>
    <vegetable> cilantro </vegetable>
    </topping>
    </description>
    </Pizza>
    Thanks in advance....
  • outofmymind
    New Member
    • Oct 2006
    • 45

    #2
    Xml

    Hey,

    I came across this question, this is the 1st time I write a XML file, and I have no idea if my work is correct, or if thats how its supposed to be.......please give me your feedback:

    Consider the following XML file that describes a pizza:
    An order for a Pizza in a restaurant, stores the name, address, and the phone number of the customer. It stores also the description of one or more pizzas. A pizza has a size (small priced at $10, medium at $13 and large at $16), a crust type (thin or thick) and one or more toppings. The toping could be meat (beef or chicken), vegetable (red onion or cilantro).

    Create an XML file that describes two different order for two different pizza.


    this is what i did:

    Code:
    <?xml version = ”1.0” ?>
    <Pizza>
    <name> My Pizza </name>
    <address> Kitchen </address>
    <phoneNumber> 065432198 </phoneNumber>
    <description> 
    <size> small </size>
    <price> $10 </price>
    <crust> thin </crust>
    <topping>
    <meat>beef </meat>
    <meat>chicken</meat>
    <vegetable> red onion </vegetable>
    <vegetable> cilantro </vegetable>
    </topping>
    </description>
    <name> His Pizza </name>
    <address> Kitchen2 </address>
    <phoneNumber> 0625678800 </phoneNumber>
    <description> 
    <size> large </size>
    <price> $16 </price>
    <crust> thick </price>
    <topping>
    <meat>beef </meat>
    <meat>chicken<meat>
    <vegetable> red onion </vegetable>
    <vegetable> cilantro </vegetable>
    </topping>
    </description>
    </Pizza>
    Thanks in advance....

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Originally posted by outofmymind
      Hey,

      I came across this question, this is the 1st time I write a XML file, and I have no idea if my work is correct, or if thats how its supposed to be.......please give me your feedback:

      Consider the following XML file that describes a pizza:
      An order for a Pizza in a restaurant, stores the name, address, and the phone number of the customer. It stores also the description of one or more pizzas. A pizza has a size (small priced at $10, medium at $13 and large at $16), a crust type (thin or thick) and one or more toppings. The toping could be meat (beef or chicken), vegetable (red onion or cilantro).

      Create an XML file that describes two different order for two different pizza.


      this is what i did:

      Code:
      <?xml version = ”1.0” ?>
      <Pizza>
      <name> My Pizza </name>
      <address> Kitchen </address>
      <phoneNumber> 065432198 </phoneNumber>
      <description> 
      <size> small </size>
      <price> $10 </price>
      <crust> thin </crust>
      <topping>
      <meat>beef </meat>
      <meat>chicken</meat>
      <vegetable> red onion </vegetable>
      <vegetable> cilantro </vegetable>
      </topping>
      </description>
      <name> His Pizza </name>
      <address> Kitchen2 </address>
      <phoneNumber> 0625678800 </phoneNumber>
      <description> 
      <size> large </size>
      <price> $16 </price>
      <crust> thick </price>
      <topping>
      <meat>beef </meat>
      <meat>chicken<meat>
      <vegetable> red onion </vegetable>
      <vegetable> cilantro </vegetable>
      </topping>
      </description>
      </Pizza>
      Thanks in advance....
      Strictly speaking this should have been posted in the XML forum. The little xml knowledge I have says that maybe you can structure this in many ways. However the following seem to be required for this design

      [PHP] <order>
      <pizza>
      .....
      </pizza>
      <pizza>
      .....
      </pizza>
      </order>
      <order>
      <pizza>
      .....
      </pizza>
      <pizza>
      .....
      </pizza>
      </order>
      [/PHP]

      To represent two different orders of two different pizzas. Also name address and phone should not go under pizza but under customer so you'd have

      [PHP] <order>
      <customer>
      <name>
      .....
      </name>
      .....
      </customer>
      <pizza>
      .....
      </pizza>
      <pizza>
      .....
      </pizza>
      </order>
      [/PHP]
      i.e each order is made by a customer with a name, address etc.
      Remember however that your xml must have one root
      Maybe something like
      <order-form>
      <order>
      ...
      </order>
      </order-form>

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by outofmymind
        Hey,

        I came across this question, this is the 1st time I write a XML file, and I have no idea if my work is correct, or if thats how its supposed to be.......please give me your feedback:

        Consider the following XML file that describes a pizza:
        An order for a Pizza in a restaurant, stores the name, address, and the phone number of the customer. It stores also the description of one or more pizzas. A pizza has a size (small priced at $10, medium at $13 and large at $16), a crust type (thin or thick) and one or more toppings. The toping could be meat (beef or chicken), vegetable (red onion or cilantro).

        Create an XML file that describes two different order for two different pizza.


        this is what i did:

        Code:
        <?xml version = ”1.0” ?>
        <Pizza>
        <name> My Pizza </name>
        <address> Kitchen </address>
        <phoneNumber> 065432198 </phoneNumber>
        <description> 
        <size> small </size>
        <price> $10 </price>
        <crust> thin </crust>
        <topping>
        <meat>beef </meat>
        <meat>chicken</meat>
        <vegetable> red onion </vegetable>
        <vegetable> cilantro </vegetable>
        </topping>
        </description>
        <name> His Pizza </name>
        <address> Kitchen2 </address>
        <phoneNumber> 0625678800 </phoneNumber>
        <description> 
        <size> large </size>
        <price> $16 </price>
        <crust> thick </price>
        <topping>
        <meat>beef </meat>
        <meat>chicken<meat>
        <vegetable> red onion </vegetable>
        <vegetable> cilantro </vegetable>
        </topping>
        </description>
        </Pizza>
        Thanks in advance....
        Strictly speaking this should have been posted in the XML forum. The little xml knowledge I have says that maybe you can structure this in many ways. However the following seem to be required for this design

        [PHP] <order>
        <pizza>
        .....
        </pizza>
        <pizza>
        .....
        </pizza>
        </order>
        <order>
        <pizza>
        .....
        </pizza>
        <pizza>
        .....
        </pizza>
        </order>
        [/PHP]

        To represent two different orders of two different pizzas. Also name address and phone should not go under pizza but under customer so you'd have

        [PHP] <order>
        <customer>
        <name>
        .....
        </name>
        .....
        </customer>
        <pizza>
        .....
        </pizza>
        <pizza>
        .....
        </pizza>
        </order>
        [/PHP]
        i.e each order is made by a customer with a name, address etc.
        Remember however that your xml must have one root
        Maybe something like
        <order-form>
        <order>
        ...
        </order>
        </order-form>

        Comment

        • outofmymind
          New Member
          • Oct 2006
          • 45

          #5
          Originally posted by r035198x
          Strictly speaking this should have been posted in the XML forum. The little xml knowledge I have says that maybe you can structure this in many ways. However the following seem to be required for this design

          [PHP] <order>
          <pizza>
          .....
          </pizza>
          <pizza>
          .....
          </pizza>
          </order>
          <order>
          <pizza>
          .....
          </pizza>
          <pizza>
          .....
          </pizza>
          </order>
          [/PHP]

          To represent two different orders of two different pizzas. Also name address and phone should not go under pizza but under customer so you'd have

          [PHP] <order>
          <customer>
          <name>
          .....
          </name>
          .....
          </customer>
          <pizza>
          .....
          </pizza>
          <pizza>
          .....
          </pizza>
          </order>
          [/PHP]
          i.e each order is made by a customer with a name, address etc.
          Remember however that your xml must have one root
          Maybe something like
          <order-form>
          <order>
          ...
          </order>
          </order-form>
          Ohhh ok thanks i'l work on it and post it in the XML forum, i just thought that since this was part of the java course that im doing i should post it here........tha nks alot anyway,

          Comment

          • outofmymind
            New Member
            • Oct 2006
            • 45

            #6
            Originally posted by r035198x
            Strictly speaking this should have been posted in the XML forum. The little xml knowledge I have says that maybe you can structure this in many ways. However the following seem to be required for this design

            [PHP] <order>
            <pizza>
            .....
            </pizza>
            <pizza>
            .....
            </pizza>
            </order>
            <order>
            <pizza>
            .....
            </pizza>
            <pizza>
            .....
            </pizza>
            </order>
            [/PHP]

            To represent two different orders of two different pizzas. Also name address and phone should not go under pizza but under customer so you'd have

            [PHP] <order>
            <customer>
            <name>
            .....
            </name>
            .....
            </customer>
            <pizza>
            .....
            </pizza>
            <pizza>
            .....
            </pizza>
            </order>
            [/PHP]
            i.e each order is made by a customer with a name, address etc.
            Remember however that your xml must have one root
            Maybe something like
            <order-form>
            <order>
            ...
            </order>
            </order-form>
            Ohhh ok thanks i'l work on it and post it in the XML forum, i just thought that since this was part of the java course that im doing i should post it here........tha nks alot anyway,

            Comment

            • r035198x
              MVP
              • Sep 2006
              • 13225

              #7
              Originally posted by outofmymind
              Ohhh ok thanks i'l work on it and post it in the XML forum, i just thought that since this was part of the java course that im doing i should post it here........tha nks alot anyway,
              Not a big problem though. You don't have to post it in the XML forum then. I'll copy it over there for you so people in the XML forum can contribute and while you are posting here in the java forum.

              Comment

              • r035198x
                MVP
                • Sep 2006
                • 13225

                #8
                Originally posted by outofmymind
                Ohhh ok thanks i'l work on it and post it in the XML forum, i just thought that since this was part of the java course that im doing i should post it here........tha nks alot anyway,
                Not a big problem though. You don't have to post it in the XML forum then. I'll copy it over there for you so people in the XML forum can contribute and while you are posting here in the java forum.

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  #9
                  Is it just me or are the posts appearing twice here?

                  Comment

                  • r035198x
                    MVP
                    • Sep 2006
                    • 13225

                    #10
                    Originally posted by acoder
                    Is it just me or are the posts appearing twice here?

                    It's not you. I tempered too much with the thread while it was still in the java forum then when I copied it to here I had not fully brought it back to normal and I cannot do much with threads in this forum.

                    Comment

                    Working...