Presentation is loading. Please wait.

Presentation is loading. Please wait.

Using XML to present computer program Qingsong Yao Qingsong Yao Department of Computer Science Department of Computer Science York University York University.

Similar presentations


Presentation on theme: "Using XML to present computer program Qingsong Yao Qingsong Yao Department of Computer Science Department of Computer Science York University York University."— Presentation transcript:

1

2 Using XML to present computer program Qingsong Yao Qingsong Yao Department of Computer Science Department of Computer Science York University York University qingsongy@cs.yorku.ca qingsongy@cs.yorku.ca

3 What is XML? b eXtensible Markup Language Language for creating other languages Language for creating other languages b XML is extensible (compared to HTML) user can create new tag and use DTD or Schema to describe the structure of XML file user can create new tag and use DTD or Schema to describe the structure of XML file b XML separate content from presentation

4 WHY XML? b three prerequisites for universal computing: global communication, portable software, and portable data  Java : platform-independent program  Internet :platform-independent networking  XML : platform-independent data.

5 An example of XML and DTD Bookstore.XML <!DOCTYPE bookstore SYSTEM “Bookstore.DTD”> Beginning XML David Hunter 59.95 Professional XML Wrox Author Team 74.95 Bookstore.DTD <!ATTLIST bookstore name (#PCDATA) > <!ELEMENT book (name,author+,price) >

6 XML STANDARD XML STANDARD b MathML MathML Mathematical Markup Language Mathematical Markup Language b SVG (Scalable Vector Graphics) SVG (Scalable Vector Graphics) SVG (Scalable Vector Graphics) Describe two-dimensional graphics Describe two-dimensional graphics b XML QUERY XML QUERY XML QUERY Access,query and manipulate the XML Access,query and manipulate the XML b RDF(Resource Description Framework) RDF(Resource Description Framework) RDF(Resource Description Framework) Interoperable,machine understandable metadata Interoperable,machine understandable metadata b more standard can be found on W3C W3C

7 Using XML b Data Exchange and Translation b e-Commerce Messaging (B2B) b Identical description of data format b Powerful Search Engine and more… and more…

8 b XML can be represent by an DOM tree Programming With XML bookstore name=“chapters” book authorpricenameauthor price name Beginning XML David Hunter 59.95 Professional XMLWrox Author Team74.95 element attribute value

9 Using XML to present computer language b Background most computer languages have the same data structure and librarymost computer languages have the same data structure and library – integer, string,array, and object.. – Searching and Sorting algorithm… b Goals Present logic,algorithm or program using XML Present logic,algorithm or program using XML Can be transfered into other languages Can be transfered into other languages

10 Data Flow XML Parser Optimizer Language Generator Dom Pascal Java C file xml uml corba xml Xml Transformer b XML Transformer read source files and convert it to XML File b XML Parser read the XML file, converting it to a DOM tree b XML Optimizer can take grammar check and optimize the DOM tree a Language Generator generate source code from the DOM tree

11 Key Point b For Object -Orient language, use Java’s grammar to define DTD b For Non-Object-Orient language,use Pascal ‘s grammar b Each element should have an attribute “ID” in order to be referenced

12 DTD Example <!ATTLIST procedure id (ID|IDREF|IDREFS)

13 XML Language Example

14 Pascal and C Language File PASCAL Function square(a:integer):integer begin var c: integer; c:=a * a; result:=c; end; C int square(int a) { int c; c=a*a; return c; }

15 References b W3C XML GROUP (xml standard) http://www.w3.org/XML/ http://www.w3.org/XML/http://www.w3.org/XML/ b The XML Industry Portal http://www.xml.org b IBM XML (xml tools and articles) http://www.ibm.com/developer/xml/ http://www.ibm.com/developer/xml/ http://www.ibm.com/developer/xml/ http://www.alphaworks.ibm.com/ http://www.alphaworks.ibm.com/http://www.alphaworks.ibm.com/ b SUN XML (java and XML) http://java.sun.com/xml/ http://java.sun.com/xml/http://java.sun.com/xml/


Download ppt "Using XML to present computer program Qingsong Yao Qingsong Yao Department of Computer Science Department of Computer Science York University York University."

Similar presentations


Ads by Google