Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 XML eXtensible Markup Language. 2 What is XML?  XML היא שפה תיאורית  XML נועדה לספק דרך סטנדרטית לתיאור משמעות מידע ומבנה מידע כאשר הוא מועבר בין.

Similar presentations


Presentation on theme: "1 XML eXtensible Markup Language. 2 What is XML?  XML היא שפה תיאורית  XML נועדה לספק דרך סטנדרטית לתיאור משמעות מידע ומבנה מידע כאשר הוא מועבר בין."— Presentation transcript:

1 1 XML eXtensible Markup Language

2 2 What is XML?  XML היא שפה תיאורית  XML נועדה לספק דרך סטנדרטית לתיאור משמעות מידע ומבנה מידע כאשר הוא מועבר בין מערכות (כאשר אותן מערכות יכולות להיות גם דפדפנים, והמידע עצמו יכול להיות מסמכים, טבלאות, תוצאות שאילתא וכו').

3 3 ההבדל העיקרי בין XML לבין HTML  XML לא בא כדי להחליף את HTML  XML ו-HTML פותחו למטרות שונות אחד מהשני  XML פותח כדי להגדיר מידע, ולהתמקד על מה זה מידע.  HTML פותח כדי להציג מידע, ולהתמקד על איך שהמידע נראה.  HTML נועד להציג מידע, XML נועד להגדיר מידע

4 4 XML הוא דינמי  אוסף התגים שעוזרים לך לעצב את מסמך ה-HTML שלך, ואת המבנה שלו, מוגדרים וקבועים מראש. מי שכותב מסמכי HTML יכול להשתמש רק בתגים אלו ובתחביר של השפה  XML מאפשר הגדרת תגים דינמית בהתאם לצורך

5 5 Who invented XML? W3C World Wide Web Consortium http://www.w3c.org/ Current version of XML: XML 1.0 Third Edition

6 6 אלמנט פשוט  BIG HIT  או   או  תג התחלה תוכןתג סוף

7 7 דוגמא למסמך XML השורה הראשונה במסמך היא הגדרת ה-XML. היא תמיד צריכה להיות בראש המסמך השורה הבאה הינה האלמנט הראשון בדף, ה-Root Element השורות הבאות מגדירות 4 אלמנטים בנים (Child Elements) של אלמנט השורש Root Element

8 8 XML Syntax Jack Bauer : XML Tag Closing Tag Contents / Value Simple Element Attribute Complex Element Child Elements Empty Element Tag Root Element XML Declaration

9 9 Data Hierarchy Summary XML document is hierarchical in its nature. It can easily represent: Organizational chart. Product trees. Directory tree. etc…

10 10 Introduction  Database processing and document processing need each other  Database processing needs document processing for expressing database views  Document processing needs database processing for storing and manipulating data  As Internet usage increased, organizations wanted to make their Web pages more functional by displaying and updating data from organizational databases

11 11 XML  XML, or Extensible Markup Language, developed in early 1990s  XML is a subset of SGML, or Standard Generalized Markup Language  Today XML is a hybrid of document processing and database processing  It provides a standardized yet customizable way to describe the content of documents  XML documents can automatically be generated from database data, and vice versa  SOAP is an XML-based standard protocol for sending messages of any type, using any protocol over the Internet

12 12 XML (cont.)  XML is used for describing, representing, and materializing database views  XML is better than HTML because  It provides a clear separation between document structure, content, and materialization  It is standardized but allows for extension by developers  XML tags accurately represent the semantics of their data  Document Type Declarations (DTDs) and XML Schemas can be used to describe the content of XML documents  Both Oracle and SQL Server can produce XML documents from database data

13 13 Example: XML Document

14 14 XML DTD  XML document consists of two sections:  Document Type Declaration (DTD)  The DTD begins with DOCTYPE  Document data  XML documents could be  Type-valid if the document conforms to its DTD  Well-formed and not be type-valid, because  It violates the structure of its DTD  It has no DTD  DTD may be stored externally so many documents can be validated against the same DTD

15 15 XSLT  XSLT, or the Extensible Style Language may be used to materialize (transform) XML documents using XSL document  From XML documents into HTML or into XML in another format  XSLT is a declarative transformation language  Declarative : create rules, not procedure, to materialize the document  Transformational : transforms the input document into another document  XSLT uses stylesheets to indicate how to transform the elements of the XML document into another format

16 16 Example: External DTD

17 17 Example: XML Document

18 18 Example: XML  HTML

19 19 Example: XML  Browser

20 20 XML Schema  XML Schema is a standard for describing the content of an XML document, i.e., defining custom vocabularies  Documents that conform to an XML Schema are called schema-valid  An XML document can be well-formed and be neither type-valid nor schema-valid  Unlike DTDs, XML Schema documents are themselves XML documents that can be validated against their schema maintained by W3C

21 21 Example: XML Schema

22 22 Example: XML Schema

23 23 Elements and Attributes  Schemas consist of elements and attributes  Elements are used to carry data and attributes are used to carry metadata  Two types of elements:  Simple elements have a single data value  ComplexType elements can have one or more simple or complexType elements  ComplexType elements can have attributes

24 24 Flat Schemas  Flat schemas have all elements at the same level

25 25 Structured Schemas  Structured schemas have defined subgroups

26 26 Global Elements  To eliminate the definition duplication, elements can be declared globally, i.e., reside at the top level of the schema, and then reused

27 27 Global Elements

28 28 Example XML Industry Standards  Accounting  Extensible Financial Reporting Markup Language (XFRML)  Architecture and Construction  Architecture, Engineering, and Construction XML (aecXML)  Automotive  Automotive Industry Action Group (AIAG)  XML for the Automotive Industry (SAE J2008)  Banking  Banking Industry Technology Secretariat (BITS)  Bank Internet Payment System (BIPS)  Electronic Data Interchange  Data Interchange Standards Association (DISA)  XML/EDI Group

29 29 Example XML Industry Standards (cont.)  Human Resources  Human Resources Markup Language (hrml)  Insurance  ACORD: Property and Casualty  Real Estate  Real Estate Listing Management System (OpenMLS)  Real Estate Transaction Standard (RETS)  Software  IBM  INRIA: Koala Bean Markup Language (KBML)  Open Software Description Format (OSD)  Workflow  Simple Workflow Access Protocol (SWAP)  Workflow Management Coalition (MfMC): Wf-XML

30 30 XML Standards  XML : Extensible Markup Language  XSL : XSLT Stylesheet. The document that provides the {match, action} pairs and other data for XSLT to use when transforming an XML document  XSLT : A program that applies XSLT Stylesheets to an XML document to produce a transformed XML document  XML schema : An XML-compliant language for constraining the structure of an XML document

31 31 Additional XML Standards  Xpath  A sublanguage within XSLT used to identify parts of an XML document to be transformed  Can also be used for calculations and string manipulation  Xpointer  A standard for linking one document to another  SAX : Simple API (application program interface) for XML  An event-based parser that notifies a program when the elements of an XML document have been encountered during document parsing

32 32 Additional XML Standards (cont.)  DOM: Document Object Model  An API that represents an XML document as a tree  Each node of the tree represents a piece of the XML document  A program can directly access and manipulate a node of the DOM representation  Xquery  A standard for expressing database queries as XML documents  The structure of the query uses XPath facilities, and the result of the query is represented in an XML format  XML Namespaces: A standard for allocating terminology to defined collections  X:Name is interpreted as the element Name as defined in namespace X  Useful for disambiguating terms

33 33 Processing XML  Systems need to read XML data and process it.  Parser module.  Types of parsers:  SAX  DOM

34 34 The Parsers Role  Allow the host application to read the data stored in the XML elements.  Validate the XML document.  Construct an XML document or modify an existing one.

35 35 SAX Parser  Reads the XML in a sequential way element by element.  Uses an event mechanism to notify the host application about each new element found.  Low use of resources.

36 36 SAX Events  Start Document  End Document  Start Element  End Element  Doc Characters  XML Declaration

37 37 DOM Parser  Reads the XML document and constructs a matching Objects Tree in memory.  Provides a rich API for accessing the document objects randomly.  The main object is DOM node.

38 38 DOM Parser Cont.  Each element in the XML document is represented by a DOM node object.  The DOM node provides methods for retrieving the data it stores.

39 39 DOM Node Methods The DOM Node object provides the following methods:  getNodeName()  getNodeType()  getNodeValue()  getChildNodes()  etc…

40 40 Parsers Comparison SAXDOM SpeedFastSlow ResourcesCheapExpensive APISimpleRich

41 41 XML Functions  eDeveloper provides a set of functions to read XML data.  The functions use a DOM parser module called XERCES.

42 42 XML Functions Cont. eDeveloper provides the following XML functions: XMLGet() XMLExists() XMLFind() XMLCnt() XMLDelete() XMLInsert() XMLModify() XMLSetEncoding ()

43 43 XML Schema  Another standard from W3C.  Constraining XML document structure and contents.  The Schema itself is an XML document.  Used by parsers for validation purposes.

44 44 XML Schema Cont.  The XML Schema spec: http://www.w3.org/TR/xmlschema-0/

45 45 XSL & XSLT  XSL: a style sheet for XML.  XSLT: a transformation language for XML documents.  XSL FO: Formatting Objects for advanced styling features.

46 46 The future of XML  The next release is XML 1.1  W3C continue developing other XML based standards:  Name Spaces in XML 1.1  Xinclude  and more…


Download ppt "1 XML eXtensible Markup Language. 2 What is XML?  XML היא שפה תיאורית  XML נועדה לספק דרך סטנדרטית לתיאור משמעות מידע ומבנה מידע כאשר הוא מועבר בין."

Similar presentations


Ads by Google