Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Technical Introduction to XML Transparency No. 1 XML quick References.

Similar presentations


Presentation on theme: "A Technical Introduction to XML Transparency No. 1 XML quick References."— Presentation transcript:

1 A Technical Introduction to XML Transparency No. 1 XML quick References

2 A technical Introduction to XML Transparency No. 2 XML Declaration Version of the XML specification character encoding of the document, expressed in Latin characters, e.g., UTF-8, UTF-16, iso-8859-1, no: parsing affected by external DTD subset yes: not affected.

3 A technical Introduction to XML Transparency No. 3 Processing Instruction and comment may contain any characters except the string “--”

4 A technical Introduction to XML Transparency No. 4 Start tag with attribute ( in document) and end tag name of the attribute value or values of the attribute name(or type) of the element single or double quotes, ‘ or “ must match Each element may contain zero or more attributes start tag and end tag must match

5 A technical Introduction to XML Transparency No. 5 EMPTY Element and CDATA Section may contains any characters except the string “]]>”, characters in CDATA section will not be parsed (preserve their literal meaning).

6 A technical Introduction to XML Transparency No. 6 DOCTYPE Declaration name of the document type the internal subset of the DTD (optional) pointer to another file DSO DSC Declaration Subset Open Subset Close Keyword DOCTYPE

7 A technical Introduction to XML Transparency No. 7 Internal Subset <!DOCTYPE root [ ]> … DOCTYPE declaration include other declarations in this internal subset tags and text: the document

8 A technical Introduction to XML Transparency No. 8 External Subset <!DOCTYPE root SYSTEM “rootURI.dtd” > … DOCTYPE declaration refers to a DTD in an external subset. the other form: PUBLIC “publicLiteral” “root.dtd” tags and text: the document a file named : rootURI.dtd

9 A technical Introduction to XML Transparency No. 9 Internal and external Subsets <!DOCTYPE root SYSTEM “root.dtd” [ ]> … DOCTYPE declaration refers to an external subset and includes an internal subset. DTD is sum of both parts with internal subset taking precedence when conflict. tags and text: the document an external file

10 A technical Introduction to XML Transparency No. 10 Conditional Section (DTD only) and External-ID Include: not-include: External-ID: SYSTEM “URI” or PUBILC “publicID” “URI”

11 A technical Introduction to XML Transparency No. 11 Parameter Entity(PE) Declarations Internal Parameter Entity Keyword ENTITY percent sign % show this is a PE. name of the entity entity value (any literal) single or double quotes, ‘ or “ must match

12 A technical Introduction to XML Transparency No. 12 Parameter Entity Declarations External Parameter Entity Keyword ENTITY percent sign % show this is a PE. name of the entity pointer to a file, whose content is the entity value

13 A technical Introduction to XML Transparency No. 13 Notation declaration Notes: 1.keyword NOTATION 2.name of the notation (GIF, JPEG, PNG, etc); must be unique in DTD. 3.SYSTEM or PUBLIC identifer (PUBLIC does not require URI). EXs: 1.SYSTEM “my-gif.def” 2.PUBLIC “-//W3c PNG//PNG’s public id //EN” “pngLoc.def”

14 A technical Introduction to XML Transparency No. 14 general Entity Declarations Internal [general] Entity Keyword ENTITY name of the entity entity value (any literal) single or double quotes, ‘ or “ must match

15 A technical Introduction to XML Transparency No. 15 General Entity Declarations External Unparsed [General] Entity Keyword ENTITY Keyword NDATA followed by notation name, which must be defined name of the entity SYSTEM or PUBLIC identifier, pointer to a file, whose content is the entity value and will not be parsed.

16 A technical Introduction to XML Transparency No. 16 Predefined general entities ENTITYDisplay AsCharacter value &&&& <<&< >>> &apos;‘' "“"

17 A technical Introduction to XML Transparency No. 17 Element Declaration ANY Element keyword may contain zero or more elements and text data EMPTY ELEMENT keyword must not contain any content keyword ELEMENT name of the element type (tag name) formal definition of the element’s allowed content

18 A technical Introduction to XML Transparency No. 18 Special symbols used in content-model Connectors:, => “then” Follow with (in sequence) | => “Or” Select (only) one from the group Only one connector type per group -- no mixing! Groupings ( => start c.m or grouping ) => end c.m. or grouping Ex: (A, B, C) (A | (B,C) | (C,D)) (A,B | C) (A | B, C) Occurrence Indicators ? => optional, zero or one * => zero or more + => one or more (no indicator) => one and only one

19 A technical Introduction to XML Transparency No. 19 #PCDATA in content-model pure text content: (#PCDATA) mixed (mode) with other elements (#PCDATA | element-1 | … | element-n )* Notes: #PCDATA must be placed first must always include the *

20 A technical Introduction to XML Transparency No. 20 Attribute Declaration 1.Keyword ATTLIST 2.name of the associated element 3.name of the attribute 4.type of the attribute 5.keyword or default value Reserved attributes: xml:space :(default | preserve), preserve white space or use default xml:lang : indicate langugae of element and that element’s attributes and children.

21 A technical Introduction to XML Transparency No. 21 Types of XML Attributes CDATAData character string (default if well-formed) NMTOKEN Name Token NMTOKENS one or more name tokens (spaces between) ID Unique identifier for element IDREF reference to ID on another element IDREFS one or more IDREFs ( spaces between) ENTITY Name of an unparsed entity ENTITIES one or more names of entities Enumerations: ( a | b | c ) : list attribute values: a,b,c ( Or between) NOTATION ( x | y | z) : names of notation: ( Requires a list of values as well as the keyword. x,y,z must be declared elsewhere with NOTATION).

22 A technical Introduction to XML Transparency No. 22 Attribute Defaults “value” if omitted in document, assume this value. #REQUIRED cannot be omitted in document for validity. #IMPLIED optional. no default can be inferred; application is free to handle as appropriate. #FIXED “value” fixed value. if a different value appears in document, it is not valid.


Download ppt "A Technical Introduction to XML Transparency No. 1 XML quick References."

Similar presentations


Ads by Google