I would like to write a script which will edit multiple XML files, I would like to have a script which will do the following;
- Find tag “Preload” delete entire
tag, find “Preload=?sometext?” and delete. - Find tag “jumpable” delete entire
tag, find “jumpable=?sometext?” and delete. - Find “tween” and delete entire tag
- Replace “slide” with “title”, remove this line
- Find “offsety” and delete entire
tag - Find “offsetx” and delete entire
tag - Find “titleoffsetx” and delete
entire tag - Find “presenter” and delete entire
tag - Find “controls” and delete entire
tag - Find “demooffsetx” and “demooffsety”
and delete entire tag. - Replace “flv” with “src”, unless it is “.flv”
- Remove type tag, eg. “type=?sometext?”
Before Script:
<?xml version="1.0" encoding="utf-8"?>
<presentation>
<lesson>
<part src="0301p.flv" breadcrumb="This is example text1">
<cuepoints>
<cuepoint time="0:01" preload="priority" tooltip="Demo 3.1(A)" jumpable="yes">
<tween mode="instant" time="1" />
<slide flv="demos/0301d1.flv" demooffsetx="-180" demooffsety="60" type="demo"></slide>
<presenter />
<controls />
</cuepoint>
</cuepoints>
</part>
</lesson>
</presentation>
After Script:
<?xml version="1.0" encoding="utf-8"?>
<presentation>
<lesson>
<part src="0301p.flv" breadcrumb="This is example text1">
<cuepoints>
<cuepoint time="0:01" tooltip="Demo 3.1(A)">
<title src="demos/0301d1.flv"></title>
</cuepoint>
</cuepoints>
</part>
</lesson>
</presentation>
This simple python script should output what you want.