Docsity

Attribute - E-Commerce - Lecture Slides, Slides of Fundamentals of E-Commerce

Partial preview of the text

Download Attribute - E-Commerce - Lecture Slides and more Slides Fundamentals of E-Commerce in PDF only on Docsity!

Attribute Examples

• Examples:

<phoneNumber areaCode="069"

local="798-28434"/>

<phoneNumber local="798-28434"

areaCode="069" />

<data export='true'

expires="2004-01-09">

Docsity.com

Prolog

[1] document ::= prolog element Misc* [22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)? [23] XMLDecl ::= '' [24] VersionInfo ::= S 'version' Eq ("'" VersionNum "'" | '"'VersionNum'"') [25] Eq ::= S? '=' S? [26] VersionNum ::= ([a-zA-Z0-9_.:] | '-')+ [27] Misc ::= Comment | PI | S

• Prolog (all parts optional)

  • XML Declaration
    • must be at the beginning of the document
  • Processing Instructions
  • Document Type Declarations
  • Comments

Docsity.com

XML Declaration

• If it appears, it must be at the very beginning

of the document

• "Attributes" (exact order is important)

  • version is required (values: 1.0 , 1.1)
  • encoding is optional (values: UTF-8, UTF-16, ISO- 8859-1, ISO-8859-2, etc...)
  • standalone is optional (values: yes or no)

• Examples:

**

**

Docsity.com

Sample XML Document in

Japanese

Docsity.com

SS

DTD

Document Type Definition

Docsity.com

SS

Document Type Definition

• A Document Type Definition DTD defines by

using a formal grammar, which is part of the

XML specification (markup declaration):

  • elements,
  • structure these elements can appear,
  • attributes the elements can/must have,
  • possible and default values for attributes,
  • ... and further more.

• An XML document is valid if it has an

associated document type declaration and if

the document complies with the constraints

expressed in it.

Docsity.com

SS

Element Content children

[47] children ::= (choice | seq) ('?' | '' | '+')? [48] cp ::= (Name | choice | seq) ('?' | '' | '+')? [49] choice ::= '(' S? cp ( S? '|' S? cp )+ S? ')' [50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'

• Sequence:

• Choice (OR)

• Quantifiers (? for 0 or 1, * for 0 or more, + for 1 or more)

**

**

Docsity.com

Example Element and Attributes

**<!DOCTYPE articles [

]>
**

root element

Docsity.com