I'd like to parse and compare 2 XML files with the minidom parser as follows:
I have 2 XML files with loads of data. One is in English (the source file), the other one the corresponding French translation (the target file).
E.g.:
source file:
The French target file has an empty cross-language reference where I'd like to put in the information from the English source file whenever the 2 macros have the same ID.
I already wrote some code in which I replaced the string tag name with a unique tag name in order to identify the cross-language reference. I also extracted the ID and the Cross-language reference info from both files. Now I want to compare the 2 files and if 2 macros have the same ID, exchange the empty reference in the French file with the info from the English file.
Here is my code:
The replacement of the tag as well as the extraction of ID and cross-language reference work, but the final part where I'm trying to replace the stuff in the target file returns the error:
I didn't find any useful information on the web that helped me figure out what's wrong.
I know that my code above might look a bit messy, but I'm a beginner and things like "you should use a different parser" or "you should do it completely different" won't really help me. I'd like to know how I can find a solution by using and adjusting my code above :-).
I am grateful for any suggestions! Thanks in advance and kind regards!
Hello,
I am trying to make script to parse the install.rdf files found in firefox xpi extentions to isolate the extention ID so I can name a directory and automate installation of system-wide extension.
I am very facile with the command line, but not with programming languages (esp... (0 Replies)
Hi friends..
We have urgent requirement.We need to split the big xml having multiple orders into multiple xmls
having each order in each xml.
For Example
In input XMl will be in following format with multiple line orders..
<OrderDetail BillToKey="20100805337" Createuserid="CreateGuestOrder"... (8 Replies)
Hi,
I've a python script called aaa.py and passing an command line option " -a" to the script like, ./aaa.py -a
& Inside the script if the -a option is given I do some operation if not something else.
code looks like
./aaa.py -a
.
.
if options.a
---some operation---
if not options.a... (1 Reply)
Hello,
I am writing a python code. The output of the python code needs a little bit of parsing. From the output of python code, which has a lot of redundant data, I need to cut only those words or numbers which end with &. for example: if the output is--
"This is an example of tgbn123& what i... (0 Replies)
I am working on requirement on spreadsheet in python scripting.
I have a spreadsheet containing cell values and with background color.
I am able to read the value value but unable to get the background color of that particular cell.
Actually my requirement is to read the cell value along... (1 Reply)
Hi Folks ,
I have the different xml files at the following directory `/opt/app/rty/servers/tr/current/ops/config`
Let's say there are three files named
abc.xml
bv.xml
ert.xml
Now inside these xml there can be many tags as like shown below
<bean id="sdrt"... (6 Replies)
Hi Folks ,
I have to replace the following value in all the xml files so the value is
tcp://pondevpms1.fm.rbsgrp.net:6033,pondevpms2.fm.rbsgrp.net:6033
and the value with it need to be replaces is shown below
tcp://pondevpms1:3063
so i have fired the below command inside... (3 Replies)
Hi all...
As you know I like making code backwards compatible for as many platforms as possible.
This Python script was in fact dedicated for the AMIGA A1200 using Pythons 1.4.0, 1.5.2, 1.6.0, 2.0.1, and 2.4.6 as that is all we have for varying levels of upgrades from a HDD and 4MB FastRam... (1 Reply)