Why XML is Required

Download Why XML is Required

Post on 05-Jan-2016

18 views

Category:

Documents

0 download

Embed Size (px)

DESCRIPTION

Why XML is Required. Problem: We want to save the data and retrieve it further or to transfer over the network. This is most common requirement for any business. Solution: Design a format in which the data can saved and understand further. - PowerPoint PPT Presentation

TRANSCRIPT

SOA Introduction

1Why XML is RequiredProblem: We want to save the data and retrieve it further or to transfer over the network. This is most common requirement for any business.

Solution: Design a format in which the data can saved and understand further.- This requirement was first identified by IBM and came up with GML - GML is used only by IBM for internal projects

SGML Standardized General Markup Language- It is an improvement over GML- Initially released by IBM and later took by W3CSGML|||----HTML|||----XML

Manohar manohar.saddala@gmail.com2What is XML W3C - Set some standards to develop markup language.

To develop a MARKUP language Declare elements, attributesSet grammar rules (i.e. describe how the above declared elements, attributes can be used)

Manohar manohar.saddala@gmail.com3XML W3C - Set some standards to develop markup language.

To develop a MARKUP language Declare elements, attributesSet grammar rules (i.e. describe how the above declared elements, attributes can be used)

Manohar manohar.saddala@gmail.com4XML StandardsThe document must have exactly one top-level element (the document element or root element). All other elements must be nested within it.

Elements must be properly nested. That is, if an element starts with another element, it must also end within that same element.

Elements must have both start-tag and end-tag.

The element-type name in a start-tag must exactly match in the corresponding end-tag.

Element-type names are case-sensitive. Manohar manohar.saddala@gmail.com5XSD An XML Schema describes the structure of an XML document. An XML Schema tells about- elements that can appear in a document- attributes that can appear in a document- which elements are child elements- the order of child elements- the number of child elements- whether an element is empty or can include text- data types for elements and attributes- default and fixed values for elements and attributes

XML Schema supports- to describe allowable document content- to validate the correctness of data- to work with data from a database- to define data facets (restrictions on data)- to define data patterns (data formats)- to convert data between different data typesManohar manohar.saddala@gmail.com Schema file can contains either Simple element - Element containing only textComplex element Element containing one or more elementsNote: If an element has attribute then the element is treated as complex element

Simple Element:

- element is the root element of every XML Schema - used to define element- used to define attribute -defines the acceptable values for an element or attribute.- minimum no allowed- maximum no allowed< totalDigits>- exact no of digits allowed- limits to set of acceptable values.- limit value to series of characters- limit the length of the value- minimum length of the value- maximum length of the valueTags used in XSD:6Manohar manohar.saddala@gmail.comSimple Element E.g.:

Cont9Manohar manohar.saddala@gmail.com

XML

Receipt No< receiptno >123456. To < name >Manohar Date2012-07-13. Miscellaneous12Manohar manohar.saddala@gmail.comNamespaces13 TargetNamespaceDefaultNamespaceNames with prefix

Schema ImportSchema IncludeManohar manohar.saddala@gmail.com Is an path expression to select the nodes from XML documentXPATH:14ExpressionDescriptionNodenameselects all the nodes with the name Nodename/selects from the root node//selects the node from the current node and no matter where they are if the selection matches.Selects the current node..Selects parent of the current node@Selects attributeManohar manohar.saddala@gmail.com

Harry Potter29.99Learning XML39.95

Path ExpressionResultbookstoreSelects all nodes with the name "bookstore/bookstoreSelects the root element bookstoreNote:If the path starts with a slash ( / ) it always represents an absolute path to an element!bookstore/bookSelects all book elements that are children of bookstore//bookSelects all book elements no matter where they are in the documentbookstore//bookSelects all book elements that are descendant of the bookstore element, no matter where they are under the bookstore element//@langSelects all attributes that are named lang XPATH:15Manohar manohar.saddala@gmail.com Used to transform XML document into XHTML or any other XML document

- Root element that declares xml document as xsl style sheet- template contains rules to apply when a specified node is matched- used to extract data from the selected node.- used to iterate the array nodes and select the node.- Conditionally selecting the node- used when you have multiple conditions using and - sort the output nodesXSLT16Manohar manohar.saddala@gmail.com

Recommended

View more >