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

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter13: Views
Section: Chapter Questions
Problem 5RQ
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
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning