XML Flashcards
What is the meaning of XML?
Extensible Markup Language
What does XML do?
It describes and stores data
What are the characteristics of XML?
Flexible
Easy to share
Describes itself
Easy to extend
Vendor Independent
Platform Independent
Data is also known as
Text Node
Parent Node is also known as
Root Element
Book/authors/author. You can call this as a
Xpath otr path
It is a hierarchical data model
XML
Who uses XML
Banking
Life Sciences
Healthcare
Insurance
FInancial Markets
CrossIndustry
Chemical & Petroleum
Automotive
Retail
Electronics
Telecommunications
Energy and Utilities
What representation that uses node types
Parsed-hierarchical representation of an XML document
What representation uses root element, element, attribute, and text node
Serialized representation
A valid XML document is
A well-formed XML document
A document compliant with rules defined in an XML schema document or a document Type Definition document.
What is DTD document
Document Type Definition
A well-formed XML document is
It must have one and olny one root element
Each element begins and ends with an end tag
An element can contain other elements, attributes, or text nodes
Attribute values must be enclosed in double quotes. Text nodes, on the other hand, should not
It allows you to constrain the content of your XML documents (Kumbaga conditions)
Document Type Definition
It specify what kinds of content is allowed, where it is allowed to appear, and how many instances of certain type of content can appear
Document Type Definition
It can be declared directly inside the XML document or attached via an external file
Document Type Definition
It is relatively simple to write, but not particularly powerful or flexible
Document Type Definition
For example, to limit element content to phone numbers or integer digits, what is this example
Document Type Definition
It consist of a set of markup declations that define the document’s elements, attributes, and other information
Document Type Definition
What are the DTD markup declarations
Elements
Attributes
Entities
Notations
Processing Instructions
Comments
Parameter Entity References
What is the format of a DTD
<!DOCTYPE Name [
Document Type Definition
]>
Where Name is the name of the root node of the document and the Document Type Definition defines the content rules
What is the format for DTD Element declaration?
<!ELEMENT Name ContentSpecification>
Where Name is the name of the element
Content Specification defines the valid contents for the elemts
What are the contents that Elements can contain
EMPTY Content
ANY Content
Element Content
Mixed Content
Element that has no children
Empty Content
Element has no content constraints
ANY Content
Element can contain the listed child elements but that’s it
Element content
Element can contain elements and character data
Mixed content
This means zero or one of the indicated element
?
This means one or more of the indicated element
+
This means zero or more the indicated element
*
All attributes intended for use in a document must be declared via an
Attribute list declaration
An attribute list declaration has the format
<!ATTLIST ElemName AttrName Type DefaultDecl>
Where
ElemName is the name of the element where the attribute can be used
AttrName is the name of the attribute
Type id the attribute’s type
DefaultDecl is the default declaration
Attribute can be
String type indicated by the CDATA keyword. Which means attribute can be any string
Enumerated type which means the attribute can be one of several potential values
Tokenized type
What are the default Declaration for attributes
REQUIRED
#IMPLIED
Default Value
#FIXED
What function converts an XML document to an object
simplexml_load_file(‘xml file’)