Creating Xml Doc Flashcards
What is an element?
Describes or contains a piece of information
Form the basis of XML docs
Consists of 1)opening tag and 2) closing tag
Always appear as opening tag - optional data - closing tag
Examples of XML tags
Rare there is no data in between
The following shows how one elements can contain additional elements
Pet or friend
Elements
Tag
Empty tag
Element that doesn’t contain any content within its opening and closing tags
Abbreviated:
Ex. Empty tags =
The space in is necessary.
False. It is a standard style among XML developers
You can attach attributed to empty elements
True.
What is an attribute?
Small piece of info that appear within an elements opening tag
Consists of attribute name and corresponding attribute value which is separated by =
What is the value of an attribute?
Appears to the right of the =
Must appear within quotes
"Nick" is value
XML structures HTML in which you MUST use “” with attributes
TRUE!!!!
You can use several different attributes with a single element.
True.
Ex.
What is a nonempty element?
Element that contains content within the opening and closing tags
Can be text or additional elements
What is a nested element?
Element(s) that is contained without another element(s)
“Apartment building “ example for nesting elements
- Apartment building
- individual apartment within the building
- Individual rooms within individual apartments
- Furniture within individual rooms
- Belongings stored within furniture
Belonging elements are empty elements ( abbreviated with empty tag /> )
They are not required to house any additional info
Meaning you can describe the belonging elements solely through attributes
Non empty elements (room, furniture, apartment, apartmentbldg) often contain text content which appears between opening and closing tags
How would you make the belonging element nonempty in the apartment building example ?
//opening tag
//opening tag
Dear Michael,
I am pleased to announce you have won our
sweepstakes. If you would purchase 5 or more
magazine subscriptions you may win money.
//closing tag
//closing tag
What are the five commandments of XML?
- tag names are case sensitive
- Every opening tag must have corresponding closing tag - unless it is abbreviated as an empty tag />
- A nested tag pair cannot overlap another tag
- Attribute values must appears within quotes
- Every document must have a root element
are all the same.
FALSE. XML is case sensitive
What are the three fundamental building blocks XML relies on?
Elements
Attributes
Values