XML Flashcards

1
Q

DTD vs XSD

A

DTD is well formed(syntax)

XSD is well-formed and valid

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

HTML vs XML

A

HTML is developed to display data while XML describe data

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

DOM vs SAX parser

A

Dom is tree based parser, can read and write.

SAX parse step by step, can read

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

DTD stands for

A

Document Type Definition

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

What is DTD?

A

A Document Type Definition (DTD) defines the legal building blocks of an XML document. It defines the document structure with a list of legal elements and attributes.

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

What is XSD?

A

XSD (XML Schema Definition) is a World Wide Web Consortium (W3C) recommendation that specifies how to formally describe the elements in an Extensible Markup Language (XML) document. This description can be used to verify that each item of content in a document adheres to the description of the element in which the content is to be placed.

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

XML stands for

A

Xtensible Markup Language

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

What is XML for?

A

Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable.

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

What is JAXP

A

JAXP (Java API for XML Processing) is a rather outdated umbrella term covering the various low-level XML APIs in JavaSE, such as DOM, SAX and StAX. JAXP is Java API for XML Processing, which provides a platform for us to Parse the XML Files with the DOM Or SAX Parsers.

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

What is JAXB

A

JAXB (Java Architecture for XML Binding) is a specific API (the stuff under javax.xml.bind) that uses annotations to bind XML documents to a java object model. Where as JAXB is Java Architecture for XML Binding, it will make it easier to access XML documents from applications written in the Java programming language.

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

How do you use JAXP

A

Computer.xml File, if we want to access the data with JAXP, we will be performing the following steps

Create a SAX Parser or DOM Parser and then PArse the data, if we use DOM, it may be memory intensive if the document is too big. Suppose if we use SAX parser, we need to identify the beginning of the document. When it encounters something significant (in SAX terms, an “event”) such as the start of an XML tag, or the text inside of a tag, it makes that data available to the calling application.
Then Create a content handler that defines the methods to be notified by the parser when it encounters an event. These methods, known as callback methods, take the appropriate action on the data they receive.

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

How do you use JAXB

A

Bind the schema for the XML document.
Unmarshal the document into Java content objects. The Java content objects represent the content and organization of the XML document, and are directly available to your program. After unmarshalling, your program can access and display the data in the XML document simply by accessing the data in the Java content objects and then displaying it. There is no need to create and use a parser and no need to write a content handler with callback methods. What this means is that developers can access and process XML data without having to know XML or XML processing

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

What is JAX-P for DOM?

A
Document object Model
Tree based parser
Can read and write operation
Loads entire XML into memory
Good for deeply nested documents
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is JAX-P for SAX?

A
Simple API for XML
Read only
Much faster for smaller documents
Faster for querying
Scan from top to bottom
How well did you know this?
1
Not at all
2
3
4
5
Perfectly