memoQ error: id attribute of tag "bpt"
Thread poster: Ivana Bojcic
Ivana Bojcic
Ivana Bojcic  Identity Verified
Croatia
Member (2011)
German to Croatian
+ ...
Oct 7, 2018

Hello,

I already wrote on memoQ forums, but nobody seems to care. I really hate memoQ and all its "perks".

I receive the following error while importing from mqxlz edited in Trados:


"The required id attribute of tag "bpt" is not unique. The error occured somewhere before line 4325 and position 244."



What is to do? The file is very big and must be imported, so it cannot be entered segment by segment manually.

<
... See more
Hello,

I already wrote on memoQ forums, but nobody seems to care. I really hate memoQ and all its "perks".

I receive the following error while importing from mqxlz edited in Trados:


"The required id attribute of tag "bpt" is not unique. The error occured somewhere before line 4325 and position 244."



What is to do? The file is very big and must be imported, so it cannot be entered segment by segment manually.


Thanks in advance
Collapse


 
Natalie
Natalie  Identity Verified
Poland
Local time: 11:21
Member (2002)
English to Russian
+ ...

Moderator of this forum
SITE LOCALIZER
Hi Ivana Oct 7, 2018

Did you perform the QA check in Studio? If there is some problem with a missing/redundant/erroneous tag, it should be on the list of errors and you should be able to correct it.

 
Ivana Bojcic
Ivana Bojcic  Identity Verified
Croatia
Member (2011)
German to Croatian
+ ...
TOPIC STARTER
Unfortunately no Oct 7, 2018

Thanks Natalie, there was one tag and I corrected it, but it didn't solve it. Still the same error.

 
Elif Baykara Narbay
Elif Baykara Narbay  Identity Verified
Türkiye
Local time: 13:21
German to Turkish
+ ...
Segmentation is different in memoQ than in Studio. Oct 8, 2018

I had a similar problem once and a colleague suggested something smart which really worked. So, basically, I am suggesting the same thing over and over in such cases.

My case was: I got a studio package and imported it in memoQ. While exporting, I got a similar error and although I corrected almost everything manually, the file didn't export. The suggestion was to open the project in Studio to verify the segment number and tag in question. Indeed they were different. I have found th
... See more
I had a similar problem once and a colleague suggested something smart which really worked. So, basically, I am suggesting the same thing over and over in such cases.

My case was: I got a studio package and imported it in memoQ. While exporting, I got a similar error and although I corrected almost everything manually, the file didn't export. The suggestion was to open the project in Studio to verify the segment number and tag in question. Indeed they were different. I have found the correct segment in memoQ and fixed the error. Problem solved.

I hope it helps.

Elif
Collapse


 
Ivana Bojcic
Ivana Bojcic  Identity Verified
Croatia
Member (2011)
German to Croatian
+ ...
TOPIC STARTER
Thank you, but... Oct 11, 2018

that too didn't help.

"The error occured somewhere before line 62 and position 126." - so I go to check all lines before 62 and they are all correct. No tag mistakes, nothing.
But what is "position 126"?


 
Adam Warren
Adam Warren  Identity Verified
France
Local time: 11:21
Member (2005)
French to English
A useful algorithm that could be adapted to other perplexing cases Oct 11, 2018

Elif Baykara Narbay wrote:

My case was: I got a studio package and imported it in memoQ. While exporting, I got a similar error and although I corrected almost everything manually, the file didn't export. The suggestion was to open the project in Studio to verify the segment number and tag in question. Indeed they were different. I have found the correct segment in memoQ and fixed the error. Problem solved.

I hope it helps.

Elif


I think this is brilliant, Elif, and could perhaps be adapted to work in other cross-platform situations. Thank you.

With kind regards,

Adam Warren
(ProZ.com: IanDhu; Translator 41189)


 
Patrick Hopkins
Patrick Hopkins  Identity Verified
Italy
Local time: 11:21
Italian to English
Here's the answer Jan 29, 2020

I wasn't able to find an answer to this problem on the web but I did figure it out for myself so I thought I'd share the solution here (even though it's been about 2 years since the original post) because I'm pretty sure others will have this problem.

A few points to start with:


  • You'll need a text editor to fix the problem. I suggest something like Notepad++ because it can handle big files and highlights tags. Otherwise standard Notepad or similar should ... See more
I wasn't able to find an answer to this problem on the web but I did figure it out for myself so I thought I'd share the solution here (even though it's been about 2 years since the original post) because I'm pretty sure others will have this problem.

A few points to start with:


  • You'll need a text editor to fix the problem. I suggest something like Notepad++ because it can handle big files and highlights tags. Otherwise standard Notepad or similar should also work.

  • You'll also need a program to open ZIP files (like 7-zip or similar).

  • You need to understand if the memoQ file you're trying to import is compressed (zipped) or not. I'm not a super expert of memoQ, but I believe you can tell the difference by the extension of the filename. If the extension ends with the letter "z" (i.e. translation.docx_eng-US.mqxlz) then I believe that this means the file is compressed/zipped.

  • The memoQ error will specify a line number and position. Keep that error open on the monitor or write down those two numbers for reference later.



Now let's fix the problem. I'll be explaining from a Windows point of view. For other OSs you'll have to adapt.

memoQ files (like those of other CAT tools) are basically XML files in text format so rather easy to manipulate if there are problems. You just have to know what to look for.

If your memoQ file is zipped (i.e. extension ends in "z") then right click on it and "Open archive" with 7-Zip. You will see one or more files. Extract the one that ends in the extension .mqxliff to your desktop (it's probably named document.mqxliff).

Right click the extracted file and open it with Notepad++ or some other text editor. You should be able to read the text clearly as it is in XML format. If you see random letters and codes then the file is compressed/zipped, so you'll need to close the file and uncompress it as explained above.

Use the key combination Ctrl-G to go to the Line Number specified by the memoQ error.

You will see that the XML file basically has a few lines for each segment, but the ones that interest us are those for the source and the target. Following is an example (using square brackets [] here otherwise the lines won't be reproduced correctly in this message):

[source xml:space="preserve" mq:segpart="1842" mq:hasfollowingobject="hasfollowingobject"][bpt id="1" ctype="bold"]{}[/bpt][bpt id="1" rid="1"][/bpt][bpt id="3" rid="2"][/bpt]Informazioni relative agli strumenti finanziari derivati ex art. 2427-bis del Codice Civile[ept id="4" rid="2"][/ept][ept id="5" rid="1"][/ept][ept id="1"]{}[/ept][/source]

[target xml:space="preserve"][bpt id="1" ctype="bold"]{}[/bpt][bpt id="1" rid="1"][/bpt][bpt id="3" rid="2"][/bpt]Information on derivative financial instruments pursuant to art. 2427-bis of the Italian Civil Code[ept id="4" rid="2"][/ept][ept id="5" rid="1"][/ept][ept id="1"]{}[/ept][/target]

I've bolded the source and target lines which refer to the two parts of the segment (in this case Italian and English). The bpt tags are used to add the bold, italics etc., and each bpt is given an ID number (id="1", id="2" etc.). Ideally, the tags are repeated in both the source and the target so what's italic in the source is also italic in the target.

So where's the error?

On a few different occasions the file generated by memoQ itself (!) created an error by giving the same ID number to two bpt tags in the same line. In fact, if you look at my example lines above, you'll see that in both the source and the target id="1" was given twice in each (I've bolded the second "1" in each line). You can see that the bpt tags in the source and target are id=1, id=1, id=3, id=4. That's your error, there are two id's with 1. All you need to do is change the second "1" to a "2" (making sure there aren't any other "2"s in the line) in both the source and the target.

For my example lines the update would look like this.

[source xml:space="preserve" mq:segpart="1842" mq:hasfollowingobject="hasfollowingobject"][bpt id="1" ctype="bold"]{}[/bpt][bpt id="2" rid="1"][/bpt][bpt id="3" rid="2"][/bpt]Informazioni relative agli strumenti finanziari derivati ex art. 2427-bis del Codice Civile[ept id="4" rid="2"][/ept][ept id="5" rid="1"][/ept][ept id="1"]{}[/ept][/source]

[target xml:space="preserve"][bpt id="1" ctype="bold"]{}[/bpt][bpt id="2" rid="1"][/bpt][bpt id="3" rid="2"][/bpt]Information on derivative financial instruments pursuant to art. 2427-bis of the Italian Civil Code[ept id="4" rid="2"][/ept][ept id="5" rid="1"][/ept][ept id="1"]{}[/ept][/target]

Save the file and you're done.

At this point you can import THIS FILE (document.mqxliff) unzipped directly without rezipping it.

I've had a few cases where I had to do this process 2 or 3 times with the same file because there were other lines with repeated IDs. The problem was always the same, as was the fix. Eventually you fix them all and then the file is imported ok.

That's it.

Good luck!
Collapse


Maud Durand
 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

memoQ error: id attribute of tag "bpt"







Wordfast Pro
Translation Memory Software for Any Platform

Exclusive discount for ProZ.com users! Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value

Buy now! »
CafeTran Espresso
You've never met a CAT tool this clever!

Translate faster & easier, using a sophisticated CAT tool built by a translator / developer. Accept jobs from clients who use Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

Buy now! »