Storing and Retrieving XML Content

Because the XML recommendation makes a point of not dictating how documents must be stored, users are constantly coming up with new ways to use XML for data storage and retrieval.

Text Files

The simplest way to store an XML document is as a normal text file. The file can then be passed to an XML parser for processing, copied, or even served up by a Web server. The only technical issue that may need to be addressed is the character encoding of the file in question. The encoding="..." portion of the <?xml?> declaration is intended to tell an XML parser what character set was used to encode the document in question. By default, the encoding is assumed to be the UTF-8 encoding of Unicode. As long as your document contains only characters from the seven-bit ASCII character set, it is already compliant with the UTF-8 character set.

If you are authoring documents with a tool or on an operating system where text files are non-ASCII, you may need to change the encoding declaration to allow an XML parser to properly interpret it.

Database Integration

Many RDBMS systems (such as the latest versions of Microsoft's and Oracle's products) are incorporating the capability to transmit and receive data using XML. The most straightforward application of XML in a database application involves transmitting the results of a query as an XML document rather than as columnar text.

Unfortunately, there has been little effort at standardization of XML support among database vendors. Any application that wants to take advantage of these “special” features runs the risk of becoming tied to a particular database vendor's platform-specific extensions.

XML Servers

The XML server is a new class of database server that natively stores and retrieves data in XML format. What exactly an XML server comprises varies from product to product, but in most cases they support the following:

  • Storing and retrieving XML documents

  • Querying stored data using an XML selection syntax (such as XPath or the experimental XQuery language)

  • Tight integration with XML programming APIs such as DOM or SAX

Some of these servers actually use a RDBMS system to store and retrieve XML content, further blurring the line between XML servers, database servers, Web servers, and general- purpose application servers.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.178.181