1 / 13

XML and Databases

XML and Databases. Data and Document. There are really at least two distinct XML uses XML to describe Documents XML to describe Data. Document vs Data. XML for documents describes complex document structures: many elements with mixed content data types usually just text.

hayes-chase
Download Presentation

XML and Databases

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 and Databases

  2. Data and Document • There are really at least two distinct XML uses • XML to describe Documents • XML to describe Data

  3. Document vs Data XML for documents describes complex document structures: many elements with mixed content data types usually just text Data XML, simpler describing data structure, No or little mixed content: data types varied and important Machine to machine communication Document processing

  4. XML Data • Xml for data is usually simpler—more straight forward in structure: less hierarchical levels, no, or very few mixed elements • It is meant to be generated and read by applications • Data types are more important—thus the use of schemas rather than DTDs

  5. Reasons for XML • Explosion in the need to share data over the Internet from enterprise databases • Different database softwares, application softwares, incompatible data schemas • XML provides an easily managed format for universal communication

  6. Universal Communication Unicode Multilanguage support Application and platform independent data format Data logic separate from presentation logic

  7. Importance to Database • David Kroenke* lists these ways in which XML is important for databases • Standard means for representing domains • Standard means for expressing database views • Clean separation of structure, content and materialization • Facility for document validity checking • Industry standards for document types *Kroenke, David Database Processing, Eighth Edition: Prentice Hall, NJ, 2001, p 432

  8. Issues • XML does not always translate well to relational data models • XML has a primarily hierarchical structure • Some sort of “Data Mapping” must occur

  9. Data Mapping XML application Database server SQL Mapping to XML

  10. Approaches to Data Mapping • Result set mapping—maps the XML to the result set of an SQL Query. (A row element is created for each record. Each column becomes an element or attribute) • Schema mapping—the database structure is generated to and from XML Schema (we will cover this more later)

  11. Commercial Database Support • SQL Server—can generate XML from SQL and can update tables from XML files. • Oracle 9-I includes XSU (XML SQL Utility that will • Generate XML based on SQL queries • Extract data from XML for insert or update

  12. XML Databases • There has been some talk of creating XML databases—that is a database whose native format is XML and which processes queries with XPath and XQuery • There has also been some movement to include XML as a native Data type in Relational databases

  13. The Gist • XML is best used to communicate data • Databases are best used to store data

More Related