110 likes | 375 Views
An XML Format for Presence Buddy Lists. Speaker: Ching-Chen Chang Date: 2006.12.25. Outline. Introduction to XML XML Format Buddy List XML Format for Buddy Lists Example for Buddy Lists Reference. Introduction to XML(1/2). XML(eXtensible Markup Language)
E N D
An XML Format for Presence Buddy Lists Speaker: Ching-Chen Chang Date: 2006.12.25
Outline • Introduction to XML • XML Format • Buddy List • XML Format for Buddy Lists • Example for Buddy Lists • Reference
Introduction to XML(1/2) • XML(eXtensible Markup Language) • XML is a subset of SGML (Standard Generalized Markup Language) • HTTP、XML、SGML • XML stands for EXtensible Markup Language • XML is a markup language much like HTML • XML was designed to describe data
Introduction to XML(2/2) • XML tags are not predefined. You must define your own tags • XML uses a Document Type Definition (DTD) or an XML Schema to describe the data • XML with a DTD or XML Schema is designed to be self-descriptive • XML is a W3C Recommendation
XML Format • XML Elements are Extensible • Attributes are used to provide additional information about elements. • XML with correct syntax is Well Formed XML. • XML validated against a DTD is Valid XML.
Buddy List • If the buddy List is stored at local hardware, users only can use this computer. • If the buddy List is stored at the remote server, users can use every computer which has the application.
XML Format for Buddy Lists(1/2) • Buddylist Element <!ELEMENT buddylist (title, (group | buddy)* )> • Group Element <!ELEMENT group (title, (group | buddy)* )>
XML Format for Buddy Lists(2/2) • Buddy Element <!ELEMENT buddy (#PCDATA)> <!ATTLIST buddy href CDATA #REQUIRED date CDATA #IMPLIED> • Title Element <!ELEMENT title (#PCDATA)>
Example for Buddy Lists(1/2) • <?xml version="1.0"?> <!DOCTYPE buddylist PUBLIC "-//IETF//DTD RFCxxxx XBUDDY 1.0//EN" "xbuddy.dtd"> <buddylist> <title>Buddy list for John Doe</title> <group><title>Friends</title> <buddy uri="sip:jane.doe@example.com;method=SUBSCRIBE" date="959970634">Jane Doe</buddy> <buddy uri="sip:john.smith.company.com;method=SUBSCRIBE">John Smith</buddy> </group> <group><title>Coworkers</title> <buddy uri="sip:eric.summer@supersoft.com;method=SUBSCRIBE">Eric Summer</buddy> <buddy uri="sip:jim.nielsin@supersoft.com;method=SUBSCRIBE"> Boss - Jim</buddy> </group> </buddylist> >
Example for Buddy Lists(2/2) • <?xml version="1.0"?> <!DOCTYPE buddylist PUBLIC "-//IETF//DTD RFCxxxx XBUDDY 1.0//EN" "xbuddy.dtd"> <buddylist> <title> <p xmlns="http://www.w3.org/1999/xhtml"> <b><i><font size="+1">Important</font></i></b> People </p> </title> <buddy uri="sip:leonhard.euler@math.spbu.ru;method=SUBSCRIBE"> <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mrow> <msup> <mi>ⅇ</mi> <mrow> <mi>π</mi><mo>⁢</mo><mi>ⅈ</mi> </mrow> </msup> <mo>+</mo><mn>1</mn> </mrow> <mo>=</mo><mn>0</mn> </mrow> </math> </buddy> </buddylist>
Reference • XML中文規格書http://www.twtec.org.tw/content/application/taipei/cnt.class/index.php?grpid=5&vroot=&cntgrp_ordinal=000200070004&cnt_id=102 • Internet draft--An XML Format for Presence Buddy Lists