Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions 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
Check Mark
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.
Knowledge Booster
Background pattern image
Computer Science
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
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education