Week 7 Flashcards

1
Q

What were the main design goals of XML?

A

The design goals of the XML mark up language are:

  1. XML is easy to use over the internet
  2. XML can support a wide variety of applications
  3. XML is compatible with SGML
  4. XML has minimal features
  5. XML source documents are reasonably clear and legible to humans
  6. XML has a formal and concise design
  7. It is easy to write programs to process XML documents
  8. It is easy to create XML documents
  9. Terseness in XML mark up is not important
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Outline the structure of a standard XML document.

A
  1. The Prolog - beginning of an XML document is called the prolog. It contains the special
    PI call the XML Processing Instructions, may contain encoding and standalone information.
    “Standalone=”no” mean all Document Type Declaration (DTD), if any, is within the xml
    document. Example is

The above declaration it may then be followed by a Document Type Declaration
declaration (DOCTYPE) which refers to the “root element” and the DTD file. Example is

  1. The body of the xml document must start with the “root” element. The “root” element
    may contain one or more subelements. Consider the following example. Here root element
    is “address” which contains four other subelements. Also note that the DOCTYPE
    declaration also refers to “address” element.

<address>
170 Lygon St.
Melbourne
Victoria
3000
</address>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is meant by a document element? Give a simple example

A

For an XML document to be well-formed, the root element is the single element that
encloses all the other elements. For an XML document, the root element is the document
element. See the example in Q.2.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Explain what is meant by a document type definition.

A

Document Type Definition is the particular rules to which the document must conform. The
rules is defined by the document type declarations, attribute list declarations, entity
declarations and other components that are declared together.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain the difference between a valid and a well formed XML document.

A

A well formed XML document is the one that conforms to XML’s basic syntax while a valid
XML document is well formed as well as conforms to the rules that are predefined in the
corresponding DTD file. All valid XML documents are well formed, but NOT all well
formed documents are valid XML documents.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Construct a basic telephone directory as a simple XML document. The root element in the
document should be the phone list. The other elements should be names and telephone
numbers.

A

There can be many different solution to this problem. The following can be one.

James Cooper
6139999999

Nancy
613000000

Nancy Stern
613000000

Rober Stern
678888888

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Identify the syntax errors in the following XML document.

Joe’s Instant Antique Factory

A

The Correct version is

Joe’s Instant Antique Factory

You may still get an error message for the 2nd line. Syntactically it is
correct. The error message comes as the parser can not find
“catalogue.dtd” file in your machine.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly