Structure Flashcards

Describe data as a valid XML structure Create xml files with validated syntax and structure to describe data.

1
Q

XML is an industry standard way to define ______ and hold ______. It is easy to read (it’s just text) and most programming languages and applications recognize XML and can read and write XML. XML uses elements and attributes to describe things.

A

XML - Extensible Markup Language

XML is an industry standard way to define structure and hold content. It is easy to read (it’s just text) and most programming languages and applications recognize XML and can read and write XML. XML uses elements and attributes to describe things.

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

XML is used for structure. Define structure:

A
  1. Some things are made up of, or related to other things
  2. Some things are simple, other things are complex
  3. Things can be described
    - in order to make sense of things, we need to define a data structure for them.
  4. XML, JSON and databases can be used to contain and structure our data
  5. The image below represents different representations of hierarchical structures
  6. Data structures facilitate communication about things.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Even though data and data structures can be described in many ways, it is best to use something that most people and computers understand and recognize in order to facilitate ________ between these entities.

A

Even though data and data structures can be described in many ways, it is best to use something that most people and computers understand and recognize in order to facilitate communication between these entities.

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

Describe XML syntax:

A
  1. Element names and attributes cannot have spaces
  2. Lowercase is recommended but not mandatory
  3. For element names and attributes, use only alphanumeric, underscores, hyphens and periods.
    - In addition, you cannot start with a number, or hash sign
  4. You cannot name your element “xml”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Special characters:

There are 5 predefined entity references in XML:

A
< less than
> greater than
&amp; ampersand 
' apostrophe
" quotation mark
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Only the characters “__” and “___” are strictly illegal in XML. The ____ ____ character is legal, but it is a good habit to replace it.

A

Only the characters “ character is legal, but it is a good habit to replace it.

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

All XML documents must have a ______ node and there can be only ____ ____ node.

A

All XML documents must have a root node and there can be only ONE root node.

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

JSON:

JSON is relatively new but has become very popular in a short time as a way to communicate information. It is most prevalent in web applications as it works well with JavaScript. It is considerably less verbose than XML but does not include the _______ and ______ that XML contains.

A

JSON - Javascript Object Notation

JSON is relatively new but has become very popular in a short time as a way to communicate information. It is most prevalent in web applications as it works well with JavaScript. It is considerably less verbose than XML but does not include the sort of rules and metadata that XML contains.

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

Describe JSON Syntax:

A
  1. { } define objects.
  2. [ ] define arrays.
  3. Names and values are separated by a colon :
  4. Array elements and object properties/values are separated by commas ,
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A major advantage of JSON is that it is can be easily _____ into a native object, ready for use.

Whereas XML needs to be parsed to be useful. There are XML libraries available but they are not native and adds overhead to the app.

Since JSON is smaller, it is transmitted ______. This is important when dealing with web apps where the network can become a bottleneck.

A

A major advantage of JSON is that it is can be easily parsed into a native object, ready for use.

Whereas XML needs to be parsed to be useful. There are XML libraries available but they are not native and adds overhead to the app.

Since JSON is smaller, it is transmitted faster. This is important when dealing with web apps where the network can become a bottleneck.

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

XML is self _________.

A

XML is self documenting.

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

If you need to include special characters in your content, use:

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

All XML docs should start with the following processing instruction known as the xml declaration.

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