What attributes would you create for a “movie” XML element? What default would you use for your attributes? Which values might be fixed?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

What attributes would you create for a “movie” XML element? What default would you use for your attributes? Which values might be fixed?

Expert Solution
Step 1

Attribute:

To provide extra or additional information about an element, an attribute is used.

  • Attributes belong to elements of XML. Multiple unique attributes may have an element.
  • Further information about XML elements is given by Attribute. They describe the properties of elements to be more accurate.
  • A name-value pair is often an attribute of XML.

Syntax:

<element_name attribute1 ….. >

Contents...

</element_name>

 

Rules for creating xml attribute:

When constructing an attribute, there are certain guidelines that should be followed:

1. An attribute in a single start or empty-element tag does not repeat itself.

2. You can declare an attribute using the attribute-list declaration in the DTD declaration (Document Type Definition).

3. The attribute element is used without any quotation and the value of the attribute is used in a single(') or double (").

4. The name of an attribute and its meaning must always appear in pairs.

5. Absolute or indirect entity references to external entities should not be included in an attribute value.

 

The attributes we create for a movie XML element:

< movie category = " XYZ " >

   contents....

< / movie>

In the example above, the XML element is movie , the category is the name of the attribute, and the XYZ is the value of the attribute, and the name of the attribute and its value are always shown in pairs.

The name of the attribute is used without any quotes, but the value of the attribute is used in single(') or double quotes (")

We can use any one of the default values for attributes:

#REQUIRED - It is a required attribute
#IMPLIED    - It is a optional attribute
#FIXED        - It has a fixed value of attribute

 

Values that might  be fixed:

When you want to specify that the attribute value is unchanged and cannot be modified, the #FIXED keyword followed by the fixed value will be used.

  • Specifying version numbers is a common use of fixed attributes.
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Web Page
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education