Xml.XmlTransform.TXMLTransform.Data
Delphi
property Data: string read GetData ;
C++
__property System::UnicodeString Data = {read=GetData};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
property | public | Xml.XmlTransform.pas Xml.XmlTransform.hpp |
Xml.XmlTransform | TXMLTransform |
Description
Represents the translated string of XML.
Read Data to obtain the results of the transformation. Reading the Data property causes TXMLTransform to translate its source XML document or data packet into the destination format, which becomes the value of the Data property. The resulting XML string is not cached in memory: reading Data a second time causes TXMLTransform to perform its transformation a second time.
If the source XML is an XML document and the transformation indicates how to convert it into a data packet, Data is the contents of a data packet in XML format.
If the source XML is an XML data packet and the transformation indicates how to convert it into another type of XML document, Data is the contents of the resulting document.
There are three ways to specify the source document or data packet that is converted to produce Data:
- Use the SourceXmlFile property if the source document is a file on disk.
- Use the SourceXml property if the source document is an in-memory string of XML.
- Use the SourceXmlDocument property if the source document is available through a DOM interface (IDOMDocument).
- If SourceXmlFile is set to an invalid file name or SourceXmlFile is an empty string and SourceXml is not a valid string of XML, or SourceXmlFile and SourceXml are both empty strings and SourceXmlDocument is not set, TXMLTransform raises a TranslateException when you try to read Data.
- There are two ways to specify the transformation that converts the source XML into Data:
- Use the TransformationFile property if the transformation is stored in a file on disk.
- Use the TransformationDocument method if the transformation is available through a DOM interface (IDOMDocument).
- If TransformationFile is set to an invalid file name or TransformationFile is an empty string and TransformationDocument is not set, TXMLTransform raises a TranslateException when you try to read Data.
- You can augment the transformation by using the EmptyDestinationDocument property to supply a skeleton document that gives the form for the resulting XML document.
- When you read Data, for every user-defined node in the source XML document, TXMLTransform generates an OnTranslate event to convert the node.
Tip: When converting an XML document into a data packet, the value of Data can be assigned to a client dataset's XMLData property.