M-Exam Flashcards

1
Q

An XML element can contain?

A
  1. text
  2. attributes
  3. other elements
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

XML Naming Rules

A
  1. Element names are case-sensitive
  2. Element names must start with a letter or underscore
  3. Element names cannot start with the letters xml (or XML, or Xml, etc)
  4. Element names can contain letters, digits, hyphens, underscores, and periods
  5. Element names cannot contain spaces
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Best XML Naming Practices

A

Create descriptive names, like this: <person>, <firstname>, <lastname>.</lastname></firstname></person>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Best XML Naming Practices

A

Create short and simple names, like this: <book_title> not like this: <the_title_of_the_book>.</the_title_of_the_book></book_title>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Best XML Naming Practices

A

Avoid “-“. If you name something “first-name”, some software may think you want to subtract “name” from “first”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Best XML Naming Practices

A

Avoid “.”. If you name something “first.name”, some software may think that “name” is a property of the object “first”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Best XML Naming Practices

A

Avoid “:”. Colons are reserved for namespaces (more later).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Best XML Naming Practices

A

Non-English letters like éòá are perfectly legal in XML, but watch out for problems if your software doesn’t support them!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Naming Conversion Tip

A

Choose your naming style, and be consistent about it!

XML documents often have a corresponding database. A common practice is to use the naming rules of the database for the XML elements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

XML Attributes

A

Attribute values must always be quoted. Either single or double quotes can be used.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Things to consider when using attributes

A
  1. attributes cannot contain multiple values (elements can)
  2. attributes cannot contain tree structures (elements can)
  3. attributes are not easily expandable (for future changes)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

provide a method to avoid element name conflicts.

A

XML Namespace

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Displaying XML

A

Raw XML files can be viewed in all major browsers.

Don’t expect XML files to be displayed as HTML pages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

object can be used to request data from a web server.

A

XMLHTTPRequest

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

defines the properties and methods for accessing and editing XML.

A

XML DOM (Document Object Model)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

All modern browsers have a built-in _______ that can convert text into an XML DOM object.

A

XML Parser

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

defines a standard for accessing and manipulating documents.

A

XML DOM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

defines a standard way for accessing and manipulating HTML documents. It presents an HTML document as a tree-structure.

A

HTML DOM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

defines a standard way for accessing and manipulating XML documents. It presents an XML document as a tree-structure.

20
Q

a major element in the XSLT standard.

21
Q

can be used to navigate through elements and attributes in an XML document.

22
Q

selects the first book element that is the child of the bookstore element.

A

/bookstore/book[1]

23
Q

selects the last book element that is the child of the bookstore element.

A

/bookstore/book[last()]

24
Q

selects the last but one book element that is the child of the bookstore element.

A

/bookstore/book[last()-1]

25
selects the first two book elements that are children of bookstore element.
/bookstore/book[position()<3]
26
selects all the title elements that have an attribute named lang.
//title[@lang]
27
selects all the title elements that have a "lang" attribute with a value of "en".
//title[@lang = 'en']
28
selects all the book elements of the bookstore element that have a price element with a value greater than 35.00.
/bookstore/book[price>35.00]
29
selects all the title elements of the book elements of the bookstore element that have a price element with a value greater than 35.00.
/bookstore/book[price>35.00]/title
30
is often used for distributing data over the Internet.
XML
31
Important XML Standards
1. XML AJAX 2. XML DOM 3. XML XPath 4. XML XSLT 5. XML XQuery 6. XML DTD 7. XML Schema 8. XML Services
32
was designed to store and transport data
XML
33
was designed to be self-descriptive
XML
34
XML language has no _________?
Predefined Tags
35
XML Simplifies
1. XML simplifies data sharing 2. XML simplifies data transport 3. XML simplifies platform changes 4. XML simplifies data availability
36
XML became a W3C Recommendation as early as in?
February 1998
37
Thousands of XML formats exist, in many different industries, to describe day-to-day data transactions:
Stocks and Shares Financial transactions Medical data Mathematical data Scientific measurements News information Weather services
38
XML documents are formed as?
Element Trees
39
defines the XML version and the character encoding
Prolog
40
XML Syntax Rules
1. XML Tags are Case Sensitive 2. XML Elements Must be Properly Nested 3. XML Attribute Values Must Always be Quoted 4. All XML Elements Must Have a Closing Tag
41
XML does not truncate?
Multiple Whitespaces
42
Empty elements can have __________?
Attributes
43
default encoding for HTML5, CSS, JavaScript, PHP, and SQL
UTF-8
44
designed to contain data related to a specific element.
Attributes
45
is everything from (including) the element's start tag to (including) the element's end tag.
XML Element