Help with Kalani 70-320 Training Guide question on XML schemas

Discussion in 'MCAD' started by Pookee, Sep 29, 2004.

  1. Pookee

    Pookee Guest

    In the exam questions for chapter 1 of Kalani's 70-320 training guide
    there is a question about XML schema files that I do not understand.
    Here is the question and answer:

    You have been assigned the task of developing an XML schema file to
    serve as part of the data later of your company's new Web application.
    The application will deliver details on sporing events to
    subscribers. Each sporting event is characterized by several peices
    of information, including the date, sport, and teams involved. What
    should you use to represent a sporting event in the XML schema?

    A. Complex type
    B. Simple type
    C. Element
    D. Attribute

    The answer is A. Explanation: Because the sporting event will contain
    several pieces of information, it is best represented as a complex
    type. The sonstituent pieces of information within this type can be
    represented by elements, attributes, or simple types.

    I understand that B is wrong because simple types are used to define
    constraints for element values and I see that D is wrong because the
    sporting event has more than one piece of data associated with it. My
    question is - what is the difference between A and C? An element can
    contain several pieces of information can't it? When I look at the
    XML behind the schema created in the step by steps I see that all of
    the elements are children of an <xs:complexType> element. This is not
    really explained in the book and MSDN only says that a complex type
    "determines the set of attributes and the content of an element". Can
    someone give me a more thourough explanation of what a complex type is
    and how it relates to an element and this question?
    Pookee, Sep 29, 2004
    1. Advertisements

  2. Pookee

    Hermit Dave Guest

    element and attributes are xml grammer

    <sport>basketball</sport> is an element..
    <sport team="NBA"></sport>
    team here is the attribute.

    so if you have xml like

    how can you represent it with a schema.. consider that the above is a class.
    Would Sport be a primitive type ? or could you write a custom class which
    would have different fields representing the different properties of that
    sport ?
    its a complex type or a custom class.. that my friend is the reason why its

    For the reason above it cannot be B and since we are talking about XML
    Schema and not XML in general it cannot be C or D



    Hermit Dave
    Hermit Dave, Sep 29, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.