XML A Standard for organizing data. Used for Exchanging data between systems. Used to define XHTML....

of 33 /33
XML A Standard for organizing data. Used for Exchanging data between systems. Used to define XHTML. For organizing Hierarchical data. XML tags don't have pre-defined meaning.
  • date post

    22-Dec-2015
  • Category

    Documents

  • view

    212
  • download

    0

Embed Size (px)

Transcript of XML A Standard for organizing data. Used for Exchanging data between systems. Used to define XHTML....

  • Slide 1
  • XML A Standard for organizing data. Used for Exchanging data between systems. Used to define XHTML. For organizing Hierarchical data. XML tags don't have pre-defined meaning.
  • Slide 2
  • Tree Structured Information Root element child element siblings multiple children parent of Web site XML CSS DTD Link - like student5.xml
  • Slide 3
  • HTML Page
  • Slide 4
  • student-body name major address street zipcode city state Venn Diagram View student
  • Slide 5
  • Hierarchical data Defines XML structure Access XML data XML DTD HTML eXtended Markup Language Document Type Definition XML Web site CSS and XML Examples - under XML CSS DTD Link Eg: Live xml or RSS feeds
  • Slide 6
  • SAMPLE xml FILE root element 5 th Avenue 00707 NY Harry Houdini IT more students... tag opens tag closes tag opens tag closes children of address element be careful !
  • Slide 7
  • DTD Document Type Definition Define Structure of xml file by
  • Slide 8
  • DTD governing file xml data file xml - lists data (tree-like) DTD defines underlying structure (of xml data) Cross-referenced File
  • Slide 9
  • * 0 or more times Frequency Notation exactly once + one or more addresses ? 0 or once exactly once
  • Slide 10
  • root element of tree Endpoint no children Subordinate fields DTD -governs structure consists of one or more students more subordinates Multiplicity notation 0 or 1 majors allowed
  • Slide 11
  • B.dtd A.xml XML refers to DTD DTD refers to XML root Cross-references
  • Slide 12
  • Html syntax to access xml data
  • Slide 13
  • html file DTD file xml data file CSS file html file can access data in xml file Html file refers to style sheet Multiple cross-references
  • Slide 14
  • easier to access from html harder to access from html Level 0 Level 1 Level 2 Level 3 xml (tree structured) data Html access to xml data
  • Slide 15
  • How does Html access xml data?
  • Slide 16
  • dataFld attribute Accessing name & major Link to xml data: Data Island Local name for xml file data element to retrieve Student's name: Student's major: Identifies data source for table (or other element ) only 1 template row template Table: - 1 row per student - 2 cells per row Web site XML CSS DTD Link - like student6.xml
  • Slide 17
  • id internal name for file dataFld xml element accessed Student's major: src external xml file datasrc internal reference to xml file Student's name: HTML Syntax See CSS XML Topics.doc
  • Slide 18
  • A.html D.dtd B.xml C.css To reference xml file in html To reference css in html @import "C.css" ; To reference DTD in xml Cross-references
  • Slide 19
  • DTD Errors Alter: - triggers no error - same if add an extra gpa Omit 44 from student 5.xml - triggers no diagnostic error - but html retrieval now fails even though address not requested Omit a from student 6.xml - again triggers no error - but retrieval still fails in html even though major not requested - browser says can't find resource Omit NY from student4.xml wrong name Web site CSS and XML Examples - under XML-and-CSS menu
  • Slide 20
  • Viewing XML html for accessing CSS and XML Examples - under XML-and-CSS menu - like student7.html xml data as records viewed sequentially
  • Slide 21
  • function movenext ( ) { r=stuff.recordset ; Name: if (r.absoluteposition < r.recordcount) { r.movenext( ) } function moveprevious ( ) { r=stuff.recordset ; if (r.absoluteposition > 1) { r.moveprevious ( ) } Major: Move xml records thru element windows Navigation buttons Web site CSS and XML Examples - under XML-and-CSS menu student7.html xml data island
  • Slide 22
  • function movenext ( ) { r = stuff.recordset ; if (r.absoluteposition < r.recordcount) { r.movenext ( ) } function moveprevious ( ) { r=stuff.recordset ; if (r.absoluteposition > 1) { r.moveprevious ( ) } data island's xml records are available in r test if scan past r's last record advance view to next record in data island ( span & div )
  • Slide 23
  • function movenext ( ) { r = stuff.recordset ; if (r.absoluteposition < r.recordcount) { r.movenext( ) } function moveprevious ( ) { r=stuff.recordset ; if (r.absoluteposition > 1) { r.moveprevious ( ) } records from external xml source #stuff current r record number of records in r move next record from data island into view don't fall past right end
  • Slide 24
  • r = stuff.recordset r.absoluteposition r.recordcount r.movenext ( ) datasrc = internal name for xml file dataFld = element's name