LN 5 XML

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/21

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

22 Terms

1
New cards

Extensible Markup Language (XML)

  • A meta-language that describes the content of the document

  • Provides a portable method for encapsulating and describing data

  • Defines markup languages

2
New cards

Java = portable programs so XML =

portable data

3
New cards

Tag or Grammar of the language

XML does not specify the tag or grammar of the language

4
New cards

Tag

  • Markup tags that have meaning to a language processor

5
New cards

Grammar

Defines correct usage of a language’s tag

6
New cards

Tags in XML vs Tags in HTML

Tags in XML are defined by the author while tags in HTML are predefined by the W3C standard

7
New cards

XML Components

  • Prolog

  • Components of the document

8
New cards

Prolog

Defines the xml version, entity definitions, and DOCTYPE

9
New cards

Components of the document

  • Tags and attributes

  • CDATA (character data)

  • Entities

  • Processing instructions

  • Comments

10
New cards

XML Elements

  • XML tag with encapsulated data

  • Element contents must be character data in the encoding character set, no binary data

11
New cards

Tag names rules:

  • Case sensitive

  • Start with a letter or underscore

  • After first character, numbers, ‘-’ and ‘.’ are allowed

  • Cannot contain whitespaces

  • Avoid use of colon expect for indicating namespaces, discussed later

12
New cards

XML Element Attributes

  • Provide metadata for the element

  • Attribute names must adhere to the same rules as element names

  • For every attribute, there must be a value, even if the value is an empty string

  • No duplicate attributes within a single element

13
New cards

Document Entities

  • Entities refer to a data item, typically text

  • Entities are user definable

14
New cards

Well-formed vs Valid XML Documents

  • An XML document can be well-formed if it follows basic syntax rules.

  • An XML document is valid if its structure matches a Document Type Definition (DTD).

15
New cards

Commonly abused XML syntax rules:

  • Element and attribute names must be legal XML names

  • Characters < and & must be escaped as character entities when used in text

  • Every element must be closed

  • Attributes must have values and values must be delimited with quotation marks

  • Every element except the root element must be the child of exactly one element

  • Comments must be properly formed, in particular, a comment may not contain the string “--”

16
New cards

Two Solutions to validating XML documents

  1. Document Type Definition (DTD)

  2. XML Schema

17
New cards

Document Type Definition (DTD)

  • Sequence of declarations enclosed in a DOCTYPE declaration or stored separately and referred to from a DOCTYPE

  • Defines Structure of the Document

18
New cards

What DTD defines

  • Allowable tags and their attributes

  • Attribute values constraints

  • Nesting of tags

  • Number of occurrences for tags

  • Entity definitions

19
New cards

Formal Public Identifier (FPI) has four parts:

  1. Connection of DTD to a formal standard

  2. Group responsible for the DTD

  3. Description and type of document

  4. Language used in the DTD

20
New cards

Types of Elements

  • ANY

  • EMPTY

  • PCDATA

  • elements

  • mixed

21
New cards

Attribute Modifiers

  • #IMPLIED

  • #REQUIRED

  • #FIXED 

  • Default Value

22
New cards

Limitations of DTD

  • DTD itself is not in XML format

  • Does not express data types

  • Does not allow one to specify a specific format for the data to appear in  

  • No namespace support