• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Workshop

Quiz

1:Which of the following tag names would be acceptable in an XML file?
  1. <MAIN>

  2. <First Node>

  3. <mainnode>

  4. <Important!>

A1: (a) contains illegal uppercase characters; (b) contains a space; (d) is a punctuation character. Therefore, the answer is (c).
2:What property is used to store the data contents of a node in an XML tree?
  1. data

  2. contents

  3. information

  4. text

A2: The property is (d) text.
3:What property is used to store the name of a node in an XML tree?
  1. nodeName

  2. nodeForm

  3. Name

  4. Value

A3: The property is (a) nodeName.
4:What does a star (*) mean when it appears in a DTD definition?
  1. Multiplication

  2. It is a separator

  3. The entry can appear one or more times

  4. The entry can appear zero or more times

A4: (d), the entry can appear zero or more times.

Exercises

  1. Write a node tree corresponding to the following XML data type:

    <?xml version="1.0" ?>
    <message>
    <to>STUDENT</to>
    <from>AUTHOR</from>
    <cc>Editor</cc>
    <bcc>Publisher</bcc>
    <file>Archive</file>
    <subject>Introduction to XML</subject>
    <body>Welcome to XML!</body>
    <postscript>You will enjoy learning XML.</postscript>
    </message>
    
  2. Given the following definition of a data type, write a DTD file for it:

    First name —Required, and there can be only one

    Middle name—Optional, and there can be more than one

    Last name—Required, and there can be only one

    Address—Required, and there can be more than one

    City—Required, and there can be only one

    State—Required, and there can be only one

    Email address—Optional, and there can be more than one

    Phone number—Optional, and there can be at most one


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint