MSI Factory 2.3

XML.GetElementXML

XML.GetElementXML

This is the first topic This is the last topic  

XML.GetElementXML

This is the first topic This is the last topic  

OverviewExamples

string XML.GetElementXML (

string XMLPath )

Example 1

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


Learn More: Indigo Rose Software - MSI Factory - Buy Now - Contact Us