RAD Studio
ContentsIndex
PreviousUpNext
Using an XML Document as the Source for a Provider

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 property. 

TXMLTransformProvider components use internal TXMLTransform components to translate between data packets and the source XML document: one to translate the XML document into data packets, and one to translate data packets back into the XML format of the source document after applying updates. These two TXMLTransform components can be accessed using the TransformRead and TransformWrite properties, respectively. 

When using TXMLTransformProvider, you must specify the transformations that these two TXMLTransform components use to translate between data packets and the source XML document. You do this by setting the TXMLTransform component's TransformationFile or TransformationDocument property, just as when using a stand-alone TXMLTransform component

In addition, if the transformation includes any user-defined nodes, you must supply an OnTranslate event handler to the internal TXMLTransform components. 

You do not need to specify the source document on the TXMLTransform components that are the values of TransformRead and TransformWrite. For TransformRead, the source is the file specified by the provider's XMLDataFile property (although, if you set XMLDataFile to an empty string, you can supply the source document using TransformRead.XmlSource or TransformRead.XmlSourceDocument). For TransformWrite, the source is generated internally by the provider when it applies updates.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!