OverviewExamples
-- This example assumes the sample XML is already loaded into memory.
-- get the raw XML text of the 2nd customer element
strCustomerXML = XML.GetElementXML("database/customer:2");
error = Application.GetLastError();
if (error ~= XML.OK) then
Dialog.Message("Error", _tblErrorMessages[error]);
end
-- get the customer's name from the XML
strCustomerName = XML.GetValue("database/customer:2/first_name") ..
XML.GetValue("database/customer:2/last_name");
-- save the customer record as a separate XML document in C:\customer_records
TextFile.WriteFromString( "C:\\customer_records\\"..strCustomerName..".xml"
, strCustomerXML
, false );
Gets the customer's name from the XML and then saves the customer record as a separate XML document.
See also: Related Actions