
eaf62f975c8511d4e69c52b1c0d3305b.ppt
- Количество слайдов: 16
Lecture 13 XML and its applications
Definition Extensible Markup Language, abbreviated XML, describes a class of data objects called XML documents and partially describes the behavior of computer programs which process them. XML is an application profile or restricted form of SGML, the Standard Generalized Markup Language [ISO 8879]. By construction, XML documents are conforming SGML documents. Extensible Markup Language (XML) 1. 0 (Third Edition) W 3 C Recommendation 04 February 2004
So what is it really? A document syntax (markup) standard for text documents that is simple and open (non-proprietary) for electronic data exchange and storage. It is flexible and e. Xtendable (Xml) because it allows users to create their own vocabularies (new markup languages) - no fixed set of tags as in HTML or XHTML. XML documents contain only data delimited by tags – no formatting instructions or style. Arguably the most important document syntax standard in the history of computing – “the ASCII of the Internet Age”.
A little history Developed by an XML Working Group formed under the auspices of the World Wide Web Consortium (W 3 C) in 1996. A subset of SGML (Standard Generalized Markup Language) originally designed to meet the challenges of large-scale electronic publishing. XML now adopted in fields as diverse as law, healthcare, insurance, multimedia, web publishing, EDI, telecommunications, aeronautics, engineering, software, hospitality, tourism, retail, stock trading, etc. ………
Design goals The original design goals for XML were: - that it should be straightforwardly usable over the Internet. - that it should support a wide variety of applications. - that it be compatible with SGML. - that it should be easy to write programs which process XML documents. - that the number of optional features in XML were to be kept to the absolute minimum, ideally zero. - that XML documents should be human-legible and reasonably clear. - that the XML design would be prepared quickly. - that the design of XML would be formal and concise. - that XML documents would be easy to create. - that terseness in XML markup was to be of minimal importance.
Other formats pipe dilimited nhs-no|first|middle|last|previous|preferred|………………. |email|fax 7503557856|Joseph|Michael|Bloggs|||Joe|…………………. |joe. bloggs@email. com| relational table Patient nhs-no first middle 7503557856 Joseph Michael
Example XML document deconstructed root element; every well formed xml document must be enclosed by exactly one root element. a comment; comments must be delimited by the characters as in xhtml empty elements xml version="1. 0" encoding="UTF-8"? >
Tree view of example XML document (all xml documents are hierarchical in structure) patient name nhs-no 7503557856 tel address title fax Mr first middle last Joseph Michael Bloggs previous preferred Joe street 1 street 2 2 Gloucester Rd street 3 city county postcode Bristol Avon BS 2 4 QS home 01179541054 mobile 07710234674 KEY element content attribute
Well-formed XML documents (1) Every XML document must be well-formed and must therefore adhere to the following rules (among others): 1. Every start-tag must have a matching end tag. 2. Elements may nest but must not overlap.
Well-formed XML documents (2) Element names are case sensitive -
XML Namespaces serve two functions in the XML specification: 1. To distinguish between elements and attributes from two different vocabularies with different meanings that might share the same name and hence avoid naming collisions. 2. To group all the related attributes from a single XML application together so that software can easily recognise them. Consider the following fragments from two different documents:
XML Applications (1) XSLT – Extensible Stylesheet Language Transformations is an application for specifying rules which transform one XML document into another document. It uses template rules in the stylesheet to match patterns in the input document and when a match is found it writes the template from the rule to the output tree. We will look at XSLT in detail in Lecture 15.
XML Applications (2) XLinks - is the XML Linking Language. It defines how one document links to another. It is divided into two parts XLinks and XPointer (which identifies a particular part of the document (re: anchors in HTML)). XPath – XPath is a non-XML language for identifying particular parts of an XML document. It is designed to be used in conjunction with the Extensible Stylesheet Language Transformations (XSLT) and XPointer. XForms – is the W 3 C’s name for a specification of Web forms that can be used with a wide variety of platforms including desktop computers, hand helds, information appliances and even paper. XQuery – an XML based query language to extract data from real or virtual documents providing the needed interaction between the Web and databases. SVG – Scalable Vector Graphics. A XML application which describes vector graphics data for JPEG, GIF and PNG for distribution and display over the web. Other applications (and the list is growing rapidly) include – XML Signature, XML Encryption, Web Services (SOAP, WDSL & UDDI), XML Key Management, Synchronized Multimedia Integration Language (SMIL), etc.
XML Vocabularies XHTML – the Extensible Hyper. Text Markup Language which reproduces and extends HTML. An XHTML document conforms to all rules required of a well formed XML document and drops many of the weak features of HTML e. g. the tag. WML – the Wireless Markup Language is a strict HTML type vocabulary for use with wireless -enabled devices such as mobile phones, PDA’s & pagers. Ink. ML – For representing digital ink data that is input with a pen. Math. ML – For the inclusion of mathematical formulas in web pages and machine to machine communications. CML – Chemical Markup Language is a XML vocabulary for representing molecular and chemical information. A formula can be transformed into a graphic represenation for displaying on a web page. Others standardized vocabularies include the Banking Industry Technology Secretariat (BITS); Financial Exchange (IFX); Bank Internet Payment System (BIPS); Telecommunications Interchange Markup (TIM); Common Business Library (x. CBL); Electronic Business XML Initiative (eb. XML); Product Data Markup Language (PDML); Financial Information e. Xchange protocol (FIX); The Text Encoding Initiative (TEI) and hundreds of others.
Tasks 1. Use the web to look up and ensure you understand the following terms in the context of XML and related technologies: - metadata namespaces URI & URL processing instruction well-formed valid parsing 2. Why are namespaces so necessary? Discuss. 3. Visit the site XML. com and look through Tim Bray’s annotated xml specification. Use the link http: //www. xml. com/pub/a/98/09/exexegesis-0. html? page=2 to consider how he built this application. 4. Now you have some idea of XML – consider how you might make use of it if you had chance to redo the first term assignment