In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces the XML database example analysis, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
The original XML database
A primitive XML database (NXD) can be simple or complex. I define a database concept like this: a collection of permanently stable data. Under this definition, an NXD can logically store an XML document. When XML:DB initiative has more requirements for a NXD, I think the above definition can also be met.
The following lines of code can be used as a NXD:
< diet > < meal mealName= "breakfast" > < item itemName= "toast" unit= "slice" quantity= "2" / > < item itemName= "bacon" unit= "strip" quantity= "2" / > < / meal > < / diet >
Obviously, the collection of data is stored in XML format. If it were stored in a flat file, it would also satisfy our definition of NXD: a collection of permanently stable data.
An NXD uses the same way to store XML documents (such as flat files, relational or level databases, object databases).
Flat file
A simple flat file is the simplest XML database model. As a "variant", you can store many XML documents in a directory level. To extend the previous example, look at the following model:
Diets\ Diets\ AtkinsDay1.xmlDay2.xmlDay3.xmlDay4.xmlDiets\ 3DayDietDay1.xmlDay2.xmlDay3.xml
The Diets directory contains subdirectories, and each subdirectory has many flat files for XML.
Relation database
XML databases in relational databases can be divided into three models: coarse-grained (rough texture type), medium-grained (medium texture type), or fine-grained (fine texture type).
The coarse-grained (rough texture) model is logically different from the flat file model. You can use a relational database to store every XML document. For example, the following code can hold an XML document:
Create table diets (dietName varchar2 (30), xmlDocument varchar2 (32000))
The fine-grained (fine texture) model maps each component of an XML document to a relational database. In order to be able to transfer the flat model to a relational database, you must use two changes. For the above example, you can no longer use the subdirectory name to represent the name of the diet, nor can you use the name of the file to pass the date of the diet. Table A shows the file type definition (DTD) of the XML document for diet; Table B shows the data definition language (DDL) that maps DTD to relational tables. In addition, Table C includes the corresponding XML syntax.
The medium-grained (medium texture) model is between the coarse-grained (rough texture) model and the fine-grained (fine texture) model. Using this model, you can store information in the xml_items column of the meals table.
Object database
You can also execute NXD by using an object database. Some object databases are based on the document object Model (DOM), which allows XML to be closely integrated with the database. For example, once you provide a food DTD, you can start saving those foods without the need for additional configuration.
Database management system
For DBMS, you have a variety of options. You can build your own DBMS by using open programs such as eXist or Ozone, or buy commercial products such as Tamino XML Server.
The vast majority of relational database vendors enable their databases to use XML, or at least XML databases (XEDBs) can return the results of XML document queries. Many others can also save XML data. For example, Oracle provides a XML profiler, a Xpath engine, a XSLT processor, a XMLSQL tool, and ways to use XML.
So what's the difference between a NXD stored in a relational database and a XEDB that stores XML data? One NXD is based on the concept of XML documents, while XEDB is not too much related to others. Moreover, many specifications apply to NXD, while DBMS only applies to standard queries and XML documents that store data, such as Xpath.
XML database is not a new concept
XML database is not a new concept from a logical point of view, although it is new in logical execution. If you want to execute a XML database, you can use NXD,XEDB, or a combination of both. However, if your company already has some investment in the existing database, the first survey you do is to verify that your DMBS vendor provides tools to use XML. No matter which XML database method you use, it is most important that you have a good understanding of the characteristics of each database.
Thank you for reading this article carefully. I hope the article "sample Analysis of XML Database" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.