RAD Studio
ContentsIndex
PreviousUpNext
Using XML in database applications
Name 
Description 
Once you have created a transformation file that indicates how to transform an XML document into a data packet, you can create data packets for any XML document that conforms to the schema used in the transformation. These data packets can then be assigned to a client dataset and saved to a file so that they form the basis of a file-based database application.
The TXMLTransform component transforms an XML document into a data packet according to the mapping in a transformation file.
Note: You can also use TXMLTransform to convert a data packet that appears in XML format... more 
Before you can convert between data packets and XML documents, you must define the relationship between the metadata in a data packet and the nodes of the corresponding XML document. A description of this relationship is stored in a special XML document called a transformation.
Each transformation file contains two things: the mapping between the nodes in an XML schema and the fields in a data packet, and a skeletal XML document that represents the structure for the results of the transformation. A transformation is a one-way mapping: from an XML schema or document to a data packet or... more 
XML provides a text-based way to store or describe structured data. Datasets provide another way to store and describe structured data. To convert an XML document into a dataset, therefore, you must identify the correspondences between the nodes in an XML document and the fields in a dataset.
Consider, for example, an XML document that represents a set of email messages. It might look like the following (containing a single message):  
The TXMLTransformClient component acts as an adapter to let you use an XML document (or set of documents) as the client for an application server (or simply as the client of a dataset to which it connects via a TDataSetProvider component). That is, TXMLTransformClient lets you publish database data as an XML document and to make use of update requests (insertions or deletions) from an external application that supplies them in the form of XML documents.
To specify the provider from which the TXMLTransformClient object fetches data and to which it applies updates, set the ProviderName property. As with the... more 
The TXMLTransformProvider component lets you use an XML document as if it were a database table. TXMLTransformProvider packages the data from an XML document and applies updates from clients back to that XML document. It appears to clients such as client datasets or XML brokers like any other provider component. For information on provider components, see Using Provider Components. For information on using provider components with client datasets, see Using a Client Dataset with a Provider.
You can specify the XML document from which the XML provider provides data and to which it applies updates using the XMLDataFile... more 
In addition to the support for connecting to database servers, Delphi lets you work with XML documents as if they were database servers. XML (Extensible Markup Language) is a markup language for describing structured data. XML documents provide a standard, transportable format for data that is used in Web applications, business-to-business communication, and so on. For information on Delphi's support for working directly with XML documents, see Working with XML Documents.
Support for working with XML documents in database applications is based on a set of components that can convert data packets (the Data property of a client dataset)... more 
The XML mapper utility, xmlmapper.exe, lets you define mappings in three ways:
  • From an existing XML schema (or document) to a client dataset that you define. This is useful when you want to create a database application to work with data for which you already have an XML schema.
  • From an existing data packet to a new XML schema you define. This is useful when you want to expose existing database information in XML, for example to create a new business-to-business communication system.
  • Between an existing XML schema and an existing data packet. This is useful when you have an... more 
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!