Hello adepters,
I have document with tag "sdc" - System Difference Code, which content is
"A". I need to change content of all instances of tag "sdc" from A to B.
I wrote simple code which produces such work.
But, I have hundreds or thousands documents with sdc=A. It is not reasonable
to make such work manually. I need to run my ACL code for many documents
from a list of files or for all documents in directory.
Does somebody knows, is it possibly to produce by ACL:
- open document (file name from a list of xml files)
- run ACL
- save and close document
- open next document from the list of files, and so on?
My code for reference for one document:
function sdca2b()
{
#
# Replace content of SDC elements from "A" to "B"
#
# find all SDC and put oids into array
#
$sdc_array = xpath_nodeset (sdc_nodes,"//sdc");
#
# Get markups SDC from array
#
for (i=1; i <= sdc_array.length; i++ )
{
goto_oid(sdc_nodes[i]);
if (oid_content(sdc_nodes[i]) == "A")
{
#
#mark and delete content of tag sdc
#
mark -noselect -noinvert begin;
goto_oid(sdc_nodes[i], -1);
mark end;
delete_mark;
# insert string "B"
is "B";
}
}
}
Thanks for all in advance,
Alexander Neder
+7 495 737 7878,
Department Manager,
PTS,
16, Marxistskya, Moscow, Russia.