CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC XML Core Concepts or Some Gory Details Instructor: Joseph DiVerdi, Ph.D., M.B.A.
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC Ground Rules XML Rules Differ From HTML Rules –Generally More Stringent Case is Significant Attributes Must be Contained in Quotes Whitespace is Not Collapsed Automatically Containers Must Always Be Closed
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC Outline Anatomy of an XML-Compliant Document –Prolog –Elements Elements –Attributes Namespace Entities –Character –Mixed-Content Well-Formedness & Validity
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC Document Anatomy XML-Compliant Document –A Reservoir of Information –Structured Data Two Separate Components –Prolog Provides Declarations to XML Software Applications –Elements Contains Marked-Up Data
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC Document Prolog Contents –XML Declaration - required –Document Type Declaration - optional Not Document Type Definition Simplest XML Prolog –Only Contains XML Declaration –Note Unique Delimiters
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC XML Declaration Several Properties Available –Version version = "1.0" Identifies Rules of Engagement Only v1.0 Currently in Existence –Encoding encoding = "iso " Identifies Character Set Used in Document –Standalone standalone = "yes" Indicates Whether or Not Other Files Are Involved
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC XML Declaration Examples –Property Order is Not Important –Parameter Names are lower case –Values are Quoted –Properties are Space-Delimited
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC Character Sets A Brief Digression...
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC Character Sets Character –A Unit of a Written Language System ay, bee, see, dee, eff, gee, aych, eye Glyph –An Actual Printed or Displayed Character = a b c 5, $ ó
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC Character Sets A Character May Associate With Several Glyphs –Close Quote - " or » A Glyph May Correspond to Several Characters –Comma - pause in sentence or decimal indicator In Certain Languages
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC Character Sets Each Character is Assigned –A Specific Numeric Value Number of Characters in a Character Set –Limited by the Bit-Depth of its Encoding 8-Bit Encoded Character Set characters 16-Bit Encoded Character Set - 65,536 characters HTML v2.0 & v3.2 are based on ISO –8-Bit Character Set AKA Latin-1
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC Character Sets ISO Character Set –8-Bit Depth First 128 Values From US-ASCII Numeric ValueGlyphDescription 13CRcarriage return 480digit zero 64Auppercase aye 94^caret 177±plus-or-minus 191¿inverted question mark 255ÿlowercase wye w/umlaut
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC Character Sets (continued) Common 8-bit character sets ISO Latin-1 ISO Cyrillic ISO Arabic ISO Greek ISO Hebrew SHIFT_JISJapanese EUC_JPJapanese
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC Uses of Character Sets LanguagesCountriesCharacter Sets Frenchfr iso Greekeliso Hebrewiwiso Hungarianhuiso Icelandicisiso Italianitiso Japanesejashift_jis, iso-2022-jp, euc-jp Romanianroiso Russianrukoi-8-r, iso Serbiansriso Slovakskiso Spanishesiso Turkishtriso Ukrainianukiso
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC Character Sets (continued) 256 Characters are Sufficient –For Certain Languages Insufficient for Others –Japanese (kanji) –Chinese –Korean –Vietnamese Hence the Need For –16-Bit Encoded Character Sets
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC Character Sets 16-Bit Encoded Character Sets –Two Contiguous Bytes Represent One Character 65,536 Possible Characters in One Set –Unicode is a 16-bit Character Set Developed by the Unicode Consortium –Practically Identical to ISO First 256 Slots Allocated to ISO –Backwards Compatible (woo-hoo!)
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC Character Sets A Brief Digression... Bottom Line –Specify Your Encoding As Required –Important For International Applications Multi-Lingual Applications There, now you know about it.
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC XML Declaration Examples –Property Order is Not Important –Parameter Names are lower case –Values are Quoted –Properties are Space-Delimited
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC Document Type Declaration Describes Root Element –Top-Level Document Container Designates DTD –Document Type Definition –For Precisely Defining Document Structure Names DTD Using Public Identifier Locates DTD Using System Identifier –Defined Internal Subset of DTD
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC Example of External DTD <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" SYSTEM " /DTD/xhtml1-strict.dtd"> Note Root Element Name Note Public Identifier –Names DTD Using Public Name See comments on p51 of text Note System URI –Tells Software Application Where to Find It
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC Example of Internal DTD <!DOCTYPE PARENT [ <!ATTLIST IDENTIFIER NUMBER ID #REQUIRED TYPE (natural|adopted|testube) "natural"> ]>
CSU - DCE Introduction to XML XML Core Concepts - Fort Collins, CO Copyright © XTR Systems, LLC Example of Ext & Int DTD <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" SYSTEM " /DTD/xhtml1-strict.dtd"> [ XML > <!ENTITY CREDO " Resistance is Futile "> ]>