You use Datacap Studio to
create the ExportXML ruleset. Also, the ruleset requires three rules.
About this task
Three separate rules are required.
- One rule that is attached to the Open element of the batch to
set the XML export path and file name.
- One rule that is attached to the rental agreement page that writes
the data for the current page.
- One rule that is attached to the Close element of the batch to
save the XML file.
Procedure
To create the ExportXML ruleset:
- In the Rulesets pane, right-click
the TravelDocs node and choose Add
Ruleset.
- Rename the new ruleset from Ruleset1 to Export
XML.
- Rename the default rule from Rule1 to Open
XML File.
- Rename the default function from Function1 to Open
XML.
- Click the Actions library tab and
expand the Export XML library.
- Select and add each of the following actions that are shown
in the following table to the Open XML function
by clicking Add to function. Then, set the
action parameters as shown in the following table.
| Action |
Parameter |
| xml_SetExportPath |
@APPPATH(export) |
| xml_SetFileName |
@BatchID |
Attention: @APPPATH(export) is a smart parameter
that gets the export path from the application configuration file.
@BatchID is a smart parameter that returns the current batch ID.
- Right-click the ExportXML ruleset
and choose Add Rule.
- Rename the new rule from Rule1 to Export
Rental Agreement XML.
- Rename the default function from Function1 to Export
XML.
- Select and add each of the following actions that are shown
in the following table to the Export XML function by clicking Add
to function. Then, set the action parameters as shown
in the following table.
| Action |
Parameter |
| xml_NewNode |
@ID,Rental_Agreements |
| xml_NewNode |
Pickup_Date,@ID |
| xml_SetNodeValue |
Pickup_Date, @P\Pickup_Date |
| xml_NewNode |
Pickup_Location,@ID |
| xml_SetNodeValue |
Pickup_Location, @P\Pickup_Location |
| xml_NewNode |
Return_Date,@ID |
| xml_SetNodeValue |
Return_Date, @P\Return_Date |
| xml_NewNode |
Return_Location,@ID |
| xml_SetNodeValue |
Return_Location, @P\Return_Location |
| xml_NewNode |
Car_Type,@ID |
| xml_SetNodeValue |
Car_Type, @P\Car_Type |
| xml_NewNode |
Options,@ID |
| xml_SetNodeValue |
Options, @P\Options |
| xml_NewNode |
Total_Cost,@ID |
| xml_SetNodeValue |
Total_Cost, @P\Total_Cost |
Attention: @ID gets the ID of the current object.
@P\ gets the value of the specified field on the current page.
- Right-click the ExportXML ruleset and choose Add
Rule.
- Rename the new rule from Rule1 to Close
XML File.
- Rename the default function from Function1 to Close
XML.
- Select and add the action that is shown in the following
table to the Close XML function by clicking Add
to function. This action has no parameter.
| Action |
Parameter |
| xml_SaveFile |
|
- In the Rulesets pane, click Save.
Then, click Lock/Unlock ruleset and choose Publish
ruleset. The finished ruleset looks like the following
example.