XML Flashcards

1
Q

What is the Document Object Model (DOM)

A

a framework for manipulating XML documents

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

What are the language-specific versions of DOM methods and objects called?

A

bindings

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

What is parsing (DOM)?

A

reading from a file to a DOM tree

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

What is serialisation (DOM)?

A

writing DOM tree to a file by converting the DOM tree into an XML character stream

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

What is processing (DOM)?

A

manipulating the DOM tree

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

In Java, how would you get the root/document element of a document?

A

doc.getDocumentElement()

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

Code to create a parser in Java

A

DocumentBuilderFactory factory
= DocumentBuilderFactory . newInstance (); DocumentBuilder parser
= factory . newDocumentBuilder ();

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

what are the three types of node?

A
  1. Element
  2. Attribute
  3. Text
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the very top of the DOM hierarchy called?

A

Document node

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

What two children does the document node always have?

A
  1. Document element
  2. Document type
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is canonicalization?

A

a process used to ensure that data is represented in a standardized and consistent form, resulting in a single DOM tree

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

Advantages of DOM (5)

A
  1. Conceptually clear
  2. Random access to entire doc
  3. Change documents
  4. Create documents
  5. Output results
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Disadvantages of DOM (5)

A
  1. We hold entire syntax tree in memory
  2. Costly if document is very large
  3. Or if the document is never complete
  4. We also have to wait for complete tree before we output results
  5. Can’t start output based on partial
    tree.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How does event-based parsing (SAX) differ from tree-based parsing (DOM)?

A

is it not required that the entire document is loaded into memory as a tree structure

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