Download presentation
Presentation is loading. Please wait.
Published byPoppy Francis Modified over 9 years ago
1
Aalborg University – Department of Production XML Extensible Markup Language Kaj A. Jørgensen Aalborg University, Department of Production XML – Extensible Markup Language
2
Aalborg University – Department of Production Extensible Markup Language (XML) XML: looks like HTML but is more than HTML XML will not replace HTML – XML will complement HTML XML is extensible – users can define custom tags Data can be formatted for displaying with HTML With XML, the meaning of data can be represented XML is a metalanguage a language for making new markup languages XML is a simplification of Standard Generalized Markup Language (SGML) Public software available for XML processing, e.g. i Java XML – Extensible Markup Language
3
Aalborg University – Department of Production XML – Schema Definition and Style Definition XML Schema and Document Type Definition (DTD) Separate files defining the structure of XML documents Well-formed XML documents folows the rules of XML Valid XML documents are well-formed and conforms with a schema file or DTD file Extensible Style Language (XSL) Style sheets can be written in XSL With XSL, XML documents can be formatted, e.g. in HTML Different XSL style sheets can format XML documents differently XML – Extensible Markup Language
4
Aalborg University – Department of Production XML – Extensible Markup Language HTML Example: Lime Jello Marshmallow Cottage Cheese Surprise Lime Jello Marshmallow Cottage Cheese Surprise My grandma's favorite (may she rest in peace). Ingredients Qty Units Item 1 box lime gelatin 500 g multicolored tiny marshmallows 500 ml cottage cheese dash Tabasco sauce (optional) Instructions Prepare lime gelatin according to package instructions...
5
Aalborg University – Department of Production Hypertext Markup Language (HTML) Characteristics of HTML: isn't extensible is very display-centric isn't directly reusable only provides one 'view' of data has little or no semantic structure HTML documents are presented with a browser View the HTML document with the IE browser: example: Recipe.html XML – Extensible Markup Language
6
Aalborg University – Department of Production XML tags – User Definable Start tag: XML – Extensible Markup Language Empty tag: End tag:
7
Aalborg University – Department of Production XML – Extensible Markup Language Lime Jello Marshmallow Cottage Cheese Surprise My grandma's favorite (may she rest in peace). 1 lime gelatin 500 multicolored tiny marshmallows 500 Cottage cheese Tabasco sauce Prepare lime gelatin according to package instructions
8
Aalborg University – Department of Production Characteristics of XML Some simple rules must be obeyed: No unclosed tags No overlapping tags – example: Let's call the whole thing off Attribute values must be enclosed in quotes The text characters ( ), (") and (space) must be represented by 'character entities': (<), (>), (") and ( ) The tag names define the meaning of data Data + meaning = information The hierarchy of tags define the information structure The tags don't define how the document is displayed Browsers can display XML documentes – example: Recipe.xml XML – Extensible Markup Language
9
Aalborg University – Department of Production Document Type Definition (DTD) DTD example: XML – Extensible Markup Language
10
Aalborg University – Department of Production XML – Extensible Markup Language XML Schema example:
11
Aalborg University – Department of Production XML – Extensible Markup Language XML document conforming to the XML Schema: Tove Svendson Ragnhildvei 2 4000 Stavanger Norway Empire Burlesque 1 10.90 Hide your heart 1 9.90
12
Aalborg University – Department of Production Hierarchcical View of XML Documents Recipe example: Recipe Name Description Ingredients Ingredient Qty Item … Instructions Step … XML – Extensible Markup Language
13
Aalborg University – Department of Production Xpath Xpath is an expression language for Express addresses/links Navigation in XML documents Selection of sets of XML elements XPath is used in XSL/XSLT XLink, Xpointer and XQuery Xpath expression syntax axes::pathexpression[predicate] Path expressions are either Full path expressions or Relative path expressions XML – Extensible Markup Language
14
Aalborg University – Department of Production Xpath – Path Expressions Full Path Expressions Expresses a full path from the root node of a document Examples: /Recipe – selects all nodes /Recipe/Name – selects the Name node Relative Path Expressions Expresses a path from current node Examples: //Description – selects the Description node //Ingredient – selects all Ingredient nodes //Item – selects Item node in first Ingredient node XML – Extensible Markup Language
15
Aalborg University – Department of Production Xpath - Predicates Predicates are expressions to filter selected node sets Examples: //Ingredient[2] – Second ingredient node //Ingredient[last()]Last ingredient node //Ingredient[3]/Qty/@unit – The unit attribute of Qty node //Ingredient[Qty>200]Ingredient nodes with Qty>200 //Ingredient[Qty>200]/ItemItem nodes for which Qty>200 XML – Extensible Markup Language
16
Aalborg University – Department of Production Xpath - Axes Additional standard path expressions Reserved words: child descendant parent ancestor following preceding Attribute Example with /Recipe/Ingredients as current node: descendant::Item[@optional=“1”] XML – Extensible Markup Language
17
Aalborg University – Department of Production Style Sheets in Extensible Style Language (XSL) XSL style sheets define how to format XML documents, e.g. HTML, RTF and SQL input elements can be rearranged with style sheets are defined by Cascading Style Sheet language (CSS) Extensible Style Language (XSL) are also XML documents contain special tags with pre-defined meaning Each XSL style sheet contains a series of templates Different XSL style sheets can transform XML documents for different applications and display equipment XML – Extensible Markup Language
18
Aalborg University – Department of Production XML – Extensible Markup Language XSL Style Sheet:...
19
Aalborg University – Department of Production XML – Extensible Markup Language XSL Style Sheet – individual templates:
20
Aalborg University – Department of Production XML – Extensible Markup Language XSL Style Sheet – individual templates: Ingredients Qty Units Item -- optional
21
Aalborg University – Department of Production XML – Extensible Markup Language XSL Style Sheet – individual templates: Instructions
22
Aalborg University – Department of Production Exchanging XML Documents XML – Extensible Markup Language
23
Aalborg University – Department of Production Exchanging XML Documents, cont. XML – Extensible Markup Language
24
Aalborg University – Department of Production Application Integration XML – Extensible Markup Language
25
Aalborg University – Department of Production New Internet Technologies and Standards XML is the basis for Web Services expose and describe itself to other applications can be located by other applications via directories can be invoked by using standard protocols XML based standards are currently available Simple Object Access Protocol (SOAP) Web Services Desription Language (WSDL) Universal Desription, Discovery, and Integrat. (UDDI) a standard for new ways of publishing services conform to the basic ”request” and ”response” functionality supported by the World Wide Web Consortium (W3C) XML – Extensible Markup Language
26
Aalborg University – Department of Production Internet Technologies and Standards XML – Extensible Markup Language
27
Aalborg University – Department of Production Internet Technologies and Standards Discovery and access to an Internet Service (example) 1.a A Service Provider creates a service 1.b The service is defined in WSDL 1.c The service is published in a Service Directory 2.a A Service Client queries the directory 2.b The directory creates a reply 2.c The reply contains a WSDL descriptor of the service 3.a The Service Client invokes the service using the descriptor 3.b A SOAP message is structured, built and sent 3.c The Service Client receives and interprets the response XML – Extensible Markup Language
28
Aalborg University – Department of Production Simple Object Access Protocol (SOAP) Lightweight protocol for exchange of information The protocol is XML based, simple and extensible The SOAP standard consists of three parts the SOAP envelope, what message and who should handle it the SOAP encoding rules, serialisation mechanisms the SOAP remote procedure call representation SOAP envelope is an XML document with SOAP header, optional SOAP body, the message body, a set of body entries XML – Extensible Markup Language
29
Aalborg University – Department of Production Web Services Desription Language (WSDL) XML format for describing Internet services Abstract description of network endpoints operating on messages containing either document-oriented or procedure- oriented information Types, data type definitions, e.g. with XSD Message, definition of the data being communicated Port Type, set of supported operations by one or more endpoints Binding, protocol and data format for a particular port type. Port, single endpoint defined as binding and network address Service, a collection of related endpoints XML – Extensible Markup Language
30
Aalborg University – Department of Production Conclusion XML – Extensible Markup Language Meta language – users kan define specific languages, custom tags The tag names define the meaning of data XML Schema – definition of the structure of XML documents Extensible Style Language (XSL) – document formatting Style sheets are XML documents written in XSL Product data models can be formulated in XML Data exchange can be based on XML and XML Schema International solutions: E-business XML, WEB services XML – Extensible Markup Language
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.