• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Basic XML
 

Basic XML

on

  • 1,362 views

 

Statistics

Views

Total Views
1,362
Views on SlideShare
1,219
Embed Views
143

Actions

Likes
1
Downloads
75
Comments
0

2 Embeds 143

http://startnewday85.blogspot.com 142
http://www.startnewday85.blogspot.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Basic XML Basic XML Presentation Transcript

    • Basic XML Van Hoang Nguyen Mail: startnewday85@gmail.com Department of Computer Science
    • Computer file types cs dts htm prc asf rmvb rp mpeg2 mpg ppt mpeg4 rmx dat ra mod mpeg 7z lit rax xslt avi divx m2ts rmj b4f ramp doc vlc m3u jpeg xlsx mp2 avi wav ifo rtx ico ini pptx swf flac rvx zip mkv js gif aac sdp pdf rar css nuv dv png mlp mka rtf wma ape it xhtml mp3 xml m2v mkv mxf smil dip odp dv mov smi ppsm mpeg3 html pps cpp java flv img sea docx iso jpe mp4 tif gxf m1v config vb jpg m2t asx ppsx bmp mpeg1 oma xls ogg rm aif qt a52 tiff ac3 pot ps m3u8
    • Computer file types Is just a sequence(stream) of bits( 1s and 0s) Using special encoding Can only be read and produced by special applications meta-data is embedded Process very fastly Any data Using standard encoding Can be read and produced by any application with standard encoding no meta-data Process slowly Can not apply for all
    • Markup solution 010101011111010010101010111110111111111000001100010101010010100010101110100010101010101011111010111110100011111000111011 Beginning XML4thDavidHunterJeffRafterJoeFawcettEricvanderVlistDannyAyersJon DuckettAndrewWattandLindaMcKinnonWiley2007978-0-470-11487-2 ? , ,Beginning XML$, ,4th$, , ,David$, ,Hunter$, $, ……………………….. $, <book> <title>Beginning XML</title> <edition>4th</edition> <author> <ristName>David</firstName> <lastName>Hunter</lastName> </author> ……………………….. </book> 1. Fixed-length fields 2. Separating fields Beginning XML…… 4th…………………… David………………... ................................... 978-0-470-11487-2 3. Grouping fields Beginning XML,4th,David,Hunter,Jeff,Rafter,Joe,Fawcett,Eric,vander,Vlist,Danny,Ayers, Jon,Duckett,Andrew, Wattand,Linda,McKinnon,Wiley,2007,978-0-470-11487-2 4. Naming fields Now, We reach markup solution
    • A brief history of markup 1960’s, in publishing and printing industry The idea of separation between the contents and formating of a document 1967, William W. Tunnicliffe A set of label allowing to describe a so-called editoral structure Stanley Rice GenCode Modern Markup language Create a markup language with nested structure GML 1969, Charles Goldfard, Mosher and Raymond Lorie 1986, SGML becomes an international norm(ISO 8879/1986) World Wide Web(WWW) and HyperText Markup Language 1 (HTML 1) 1990, Berneers Lee at CERN Extensible Markup Language 1.0 (XML 1.0) 10 February 1998, XML is a W3C recommandation
    • XML Design goals XML shall be straightforwardly usable over the Internet. XML shall support a wide variety of applications. XML shall be compatible with SGML. It shall be easy to write programs which process XML documents. The number of optional features in XML is to be kept to the absolute minimum, ideally zero. XML documents should be human-legible and reasonably clear. The XML design should be prepared quickly. The design of XML shall be formal and concise. XML documents shall be easy to create. Terseness in XML markup is of minimal importance.
    • Foundations for XML XML-based Markup Languages eXtensible Markup Language XML Unicode Uniform Resource Identifier(URI)
    • XML Document <?xml version=‘1.0’ encoding=“UTF-8”?> <!-- Human Resource data--> <HumanResource> <!-- Information for a person--> <Person id=‘1’ slary=“500”> <FirstName>John</FirstName> <MidName><MidName> <LastName>Doe</LastName> <Position>Manager</Position> </Person> </HumanResource>
    • XML Document <?xml version=‘1.0’ encoding=“UTF-8”?> <!-- Human Resource data--> <HumanResource> <!-- Information for a person--> <Person id=‘1’ slary=“500”> <FirstName>John</FirstName> <MidName><MidName> <LastName>Doe</LastName> <Position>Manager</Position> </Person> </HumanResource> Tags: start-tags and end-tags Tag: the text starting with a < character and ending with a > character.
    • XML Document <?xml version=‘1.0’ encoding=“UTF-8”?> <!-- Human Resource data--> <HumanResource> <!-- Information for a person--> <Person id=‘1’ slary=“500”> <FirstName>John</FirstName> <MidName><MidName> <LastName>Doe</LastName> <Position>Manager</Position> </Person> </HumanResource> Tags: start-tags and end-tags Element All the information from the beginning of a start-tag to the end of an end-tag and including everything in between.
    • XML Document <?xml version=‘1.0’ encoding=“UTF-8”?> <!-- Human Resource data--> <HumanResource> <!-- Information for a person--> <Person id=‘1’ slary=“500”> <FirstName>John</FirstName> <MidName><MidName> <LastName>Doe</LastName> <Position>Manager</Position> </Person> </HumanResource> Tags: start-tags and end-tags Element Element content Is the text between the start-tag and end-tag of the element. Parsed character data(PCDATA)
    • XML Document <?xml version=‘1.0’ encoding=“UTF-8”?> <!-- Human Resource data--> <HumanResource> <!-- Information for a person--> <Person id=‘1’slary=“500”> <FirstName>John</FirstName> <MidName><MidName> <LastName>Doe</LastName> <Position>Manager</Position> </Person> </HumanResource> Tags: start-tags and end-tags Element Element content Attributes Are simple name/value pairs Are attached to the start-tag Must have a value(agree a empty value) Those values must be in quotes Agree both single and double quotes(note conflict)
    • XML Document <?xml version=‘1.0’ encoding=“UTF-8”?> <!-- Human Resource data--> <HumanResource> <!-- Information for a person--> <Person id=‘1’slary=“500”> <FirstName>John</FirstName> <MidName><MidName> <LastName>Doe</LastName> <Position>Manager</Position> </Person> </HumanResource> Tags: start-tags and end-tags Element Element content Attributes XML declaration Version Encoding Standalone <Yes, No>
    • XML Document <?xml version=‘1.0’ encoding=“UTF-8”?> <!-- Human Resource data--> <HumanResource> <!-- Information for a person--> <Person id=‘1’slary=“500”> <FirstName>John</FirstName> <MidName><MidName> <LastName>Doe</LastName> <Position>Manager</Position> </Person> </HumanResource> Tags: start-tags and end-tags Element Element content Attributes XML declaration Comment
    • XML Document <?xml version=‘1.0’ encoding=“UTF-8”?> <!-- Human Resource data--> <HumanResource> <!-- Information for a person--> <Person id=‘1’slary=“500”> <FirstName>John</FirstName> <MidName><MidName> <LastName>Doe</LastName> <Position>Manager</Position> </Person> </HumanResource> Tags: start-tags and end-tags Element Element content Attributes XML declaration Comment Instruction
    • Must be attached to start-tag Must have a value(can use empty string) Those values must be in quotes(can use sigle or double quotes, note: conflict) Can’t have more than one attribute with the same name on an element Names can not start with numbers or other punctuation character. Names can’t contain spaces. Names can’t contain the colon (:) character. Names can not start with the leter xml, in uppercase, lowercase, or mixed. Well-Formed XML Document Element names must obey XML naming conventions <?xml version=‘1.0’ encoding=“UTF-8”?> <!-- Human Resource data--> <HumanResource> <!-- Information for a person--> <Person id=‘1’ slary=“500”> <FirstName>John</FirstName> <MidName><MidName> <LastName>Doe</LastName> <Position>Manager</Position> </Person> </HumanResource> XML is case sensitive <Person id=‘1’ slary=“500”> <FirstName>John<MidName></FirstName></MidName> <LastName>Doe</LastName> </Person> Every start-tag mus have a matching end-tag, or be a self-closing tag Tags can’t overlap; elements must be properly nested XML documents can have only one root element XML will keep white space in PCDATA
    • Well-Formed XML Document There are some reserved characters that you can’t include in your PCDATA because they are used in XML syntax: <, > and & characters. <comparison> 6 is <7 & 7>6</comparison> <blah>Some <text in an element</blah> 1. Using escaping characters : <comparison> 6 is < 7 & 7 > 6</comparison> <blah>Some < text in an element</blah> 2. Using CDATA sections: <comparison>[CDATA[ 6 is < 7 & 7 > 6]]</comparison> <blah>[CDATA[Some <text in an element]]</blah>
    • Summary 1. Essential XML: is a markup language 2. Extensible: customer tags => You can define new markup languages 3. You known what well-formed XML document is and how to create it You had well in hand XML technology!
    • WSDL hCalendar rel-enclosure XDBMS rel-home XSLT SPARQL hCard XPath DOM rel-payment XSD rel-lience xFolk XML RDF XBase hResume DTD rel-nofollow adr XPointer XLink hReview XQuery SAX rel-directory XOXO geo vote-link XFN rel-tag XMDP hAtom