ePages 6.10 - DE_EPAGES/Installer/API/XMLFilePatcher.pm

Package DE_EPAGES::Installer::API::XMLFilePatcher

This modul uses semantic structures to generate diff between two xml files. For new and old xml file, a semantic structure will be created. These structures will be transformed so a structure is remained that contains the information about the content that should be imported or deleted in patch. To transform the structure, a structure of the original files where needed, because additional information about parent objects etc. where needed, the transformed files only contained the real diff of new and old file. After transformation the delete or import file will be generated.

@EXPORT_OK
patchXMLFile

Functions

patchXMLFiles

patchXMLFiles

compare two xml files and generates the delete file or import file needed for patch.

Syntax
patchXMLFiles($OldXMLFileName, $NewXMLFileName, $PatchFileName, $Delete);
Example
my $PatchFileName = patchXMLFiles('oldTest.xml', 'newTest.xml', 'deleteTest.xml', 1);
my $PatchFileName = patchXMLFiles('oldTest.xml', 'newTest.xml', 'importTest.xml', 0);
Input
$OldXMLFileName (string)
name of xml file, representing the old version, file have to exists
$NewXMLFileName (string)
name of xml file, representing the new version, file have to exists
$PatchFileName (string)
name of xml file, diff between old and new version are saved in these file
$Delete (bool)
if 1 delete file will created either import file