1 / 17

XML

XML. BIS4430 – unit 10. XML Origins. Extensible Markup Language (XML) 1998 Inspired by Standard Generalized Markup Language (SGML) and HTML. SGML defines how any given markup language can be formally specified HTML combines markup from several categories: Text Structuring Tags <H1>,

Télécharger la présentation

XML

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XML BIS4430 – unit 10

  2. XML Origins • Extensible Markup Language (XML) 1998 • Inspired by Standard Generalized Markup Language (SGML) and HTML. • SGML defines how any given markup language can be formally specified • HTML combines markup from several categories: Text Structuring Tags <H1>, • Formatting Tags <B>, Linking <A>, <IMG>, and Data Input Tags <FORM>,<INPUT>

  3. The key benefits of XML are: · Readable by both humans and computers · Facilitates the optimal structuring of data · Free and/or inexpensive · Widely available · Easy to learn · Supported by all major software vendors

  4. XML vs HTML <P>Book</P><P>Title: XML by Example</P><P>Author: Sean McGrath</P><P>Publisher: Prentice Hall, Inc.</P> <P>Date Published: 1999</P><P>Description: Building E-commerce Applications </P> <book><title>XML by Example</title><author>Sean McGrath</author><publisher>Prentice Hall, Inc.</publisher><publish_date>1999</publish_date><description>Building E-commerce Applications with XML</description></book>

  5. Namespaces • Namespaces resolve ambiguous element tag names, in order to associate correct elements in an XML document.

  6. Namespaces OrderInfo.xml <Order_Info> <Name>John Dow</Name> <Address>19 Footlong Court</Address> <City>Tallwood</City> <Order>Cigars</Order> <Date>31-12-02</Date> </Order_Info> BillingInfo.xml <Billing_Info> <Name>Angela Dow</Name> <Payment>Visa</Payment> <Number>12344</Number> </Billing_Info>

  7. Namespaces: Explicit <order: Order_Info xmlns:order =”http://www.mdx.ac.uk/~ariel/order” xmlns:bill=“http://www.mdx.ac.uk/~ariel/bill” > <order:Name >John Dow</order:Name> < order:Address>19 Footlong Court</ order:Address> < order:City>Tallwood</ order:City> < order:Order>Cigars</ order:Order> < order:Date>31-12-02</ order:Date> <bill:Billing_Info > < bill:Name >Angela Dow</bill:Name> < bill:Payment>Visa</ bill:Payment> < bill:Number>12344</ bill:Number> </ bill:Billing_Info> </ order:Order_Info>

  8. XML Parsers • XML processor is used to read XML documents and provide access to their content and structure • It is assumed that an XML processor is doing its work on behalf of another module, called the application

  9. XML Processing

  10. Parsers • Nonvalidating – they simply verify if the document adheres to rules of the XML syntax i.e. whether the XML document is well formed • Validating – these parsers read in XML documents, check if they are well formed and verify their compliance with a specified XML schema or other validation set, i.e. they verify if the XML document is valid.

  11. Content Access

  12. Converting XML with XSLT • XSL technologies allow to transform XML documents into various formats, such as PDF( Adobe Acrobat Reader), WML for wireless devices, and into HTML.

  13. Retrieve the element content • <xsl:value-of select="element name goes here"/> • <xsl:if test= "boolean-expression-goes here">....</xsl:if> <xsl:for-each select="element name goes here"> <!--processing instructions go here--> </xsl:for-each>

  14. Example xsl:for-each select="student_list/student"> <b>Name: </b><xsl:value-of select="name"/><p/><b>ID: </b><xsl:value-of select="student_ID"/><p/><b>Studying : </b><xsl:value-of select="major"/> </xsl:for-each>

  15. Database Integration • XML Database Mapping • More description on next slide • Using Native XML Databases • Store XML data in XML document • Data is serialised

  16. XML Database Mapping • Associate elements in an XML document with the relational database fields. • Query the database with SQL • Convert results into an XML document • Popular solution: Java & JDBC

  17. XML Web Services • Advantages of Web Services • Component independence • Component based • XML based interfaces

More Related