cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Help recovering a corrupted file

ptc-4930101
1-Visitor

Help recovering a corrupted file

When I try to open this file I get a message saying it is corrupt with the reason "element content is invalid according to the dtd/schema". Does anyone have any ideas on how I can recover the file. I will attach the file if anyone can help me out.

Thanks

14 REPLIES 14
Werner_E
25-Diamond I
(To:ptc-4930101)

Same error here.

I am not good at xml but I looked at the xml-file in textmode and could not find anything wrong at the offending line 807.

After cutting away the whole section the file loads, but there could be something missing now. I attach the Mathcad file and a textfile containing the cutted lines - the offending line is now the third one (<ml:apply>) - in case some experts could find something wrong there.

Thanks a lot! The file looks just like where I left off

Werner_E
25-Diamond I
(To:ptc-4930101)

Tom Lisofsky schrieb:

Thanks a lot! The file looks just like where I left off

Glad that it helped.

It looks like the cutted lines belong to the definition of I.req on the right side. There is an error there because of E not beeing assigned. E is defined some lines below.

StuartBruff
23-Emerald III
(To:Werner_E)

Werner Exinger wrote:

Same error here.

I am not good at xml but I looked at the xml-file in textmode and could not find anything wrong at the offending line 807.

After cutting away the whole section the file loads, but there could be something missing now. I attach the Mathcad file and a textfile containing the cutted lines - the offending line is now the third one (<ml:apply>) - in case some experts could find something wrong there.

If it's of any possible help to you in the future, you may find the 'recovery' file at this link http://communities.ptc.com/message/91122#91122 of some use. I never did get the automation to work properly, that is auto-run a worksheet and return an error if didn't run properly. Consequently, it's still rather mandraulic.

Stuart

Werner_E
25-Diamond I
(To:StuartBruff)

Thanks, I just gave it a try, but the resluting worksheet (...-test) ist just 5 bytes smaller and throws the same error.

StuartBruff
23-Emerald III
(To:Werner_E)

Did you play with the exclusion range as the instructions at the end of the recovery worksheet? I've just had a quick go and found that excluding region number 37 (region-id 328) restored the rest of the worksheet (that is, I set k in the purple region to 37..37, which then cut that region out of the worksheet). As I said, it involves rather too much user interaction to appeal to my tastes. I was hoping to find a way to automate the region exclusion process but didn't manage to do so.

(Having looked at the offending region, I opened up the original worksheet in Notepad++ and manually deleted the section between lines 805 (result) and 842 (/result); that restored the worksheet as well)

Stuart

Werner_E
25-Diamond I
(To:StuartBruff)

StuartBruff schrieb:

Did you play with the exclusion range as the instructions at the end of the recovery worksheet? I've just had a quick go and found that excluding region number 37 (region-id 328) restored the rest of the worksheet (that is, I set k in the purple region to 37..37, which then cut that region out of the worksheet). As I said, it involves rather too much user interaction to appeal to my tastes. I was hoping to find a way to automate the region exclusion process but didn't manage to do so.

(Having looked at the offending region, I opened up the original worksheet in Notepad++ and manually deleted the section between lines 805 (result) and 842 (/result); that restored the worksheet as well)

Stuart

No, I didn't play with the region exclusion, as I had no idea where to start. How did you found out (quickly) that region 37 was the faulty one?

Manually deleting that whole result-section was exactly what I did in first place.

StuartBruff
23-Emerald III
(To:Werner_E)

Werner Exinger wrote:

StuartBruff schrieb:

Did you play with the exclusion range as the instructions at the end of the recovery worksheet? I've just had a quick go and found that excluding region number 37 (region-id 328) restored the rest of the worksheet (that is, I set k in the purple region to 37..37, which then cut that region out of the worksheet). As I said, it involves rather too much user interaction to appeal to my tastes. I was hoping to find a way to automate the region exclusion process but didn't manage to do so.

(Having looked at the offending region, I opened up the original worksheet in Notepad++ and manually deleted the section between lines 805 (result) and 842 (/result); that restored the worksheet as well)

Stuart

No, I didn't play with the region exclusion, as I had no idea where to start. How did you found out (quickly) that region 37 was the faulty one?

Manually deleting that whole result-section was exactly what I did in first place.

First thing, which I gather you did, is to change the variable FileName in the magenta-highlighted region to your desired filename, excluding the ".xmcd" extension.

xmcd+recovery+v2%282%29+A.jpg

The worksheet will (should!) then read in the xmcd file and copy all of the regions into the vector regns.

The next step is to look at the number of regions converted (rows(regns)=), which gives you an idea of how many regions you've got to analyze. Having ascertained this, you set the vector exclusions to list the regions you think may be bad or that bracket the bad region. The simplest way is to assume that any bad regions lie in a contiguous block (IME, this is usually the case), then set the range variable to k to cover the last half of the regions (eg, if there are 80 regions, set k:= 40..79); this will then reconstruct the original xmcd file using only the first half of the regions. Open the resulting worksheet and see if it runs OK.

If it doesn't, drop k to, say, 20 and try again. Keep reducing k until the worksheet runs ... if it still doesn't, then the problem doesn't lie in the regions and the recovery worksheet won't help you.

If it does work, then either increase the lower bound of k (eg, 60..79) or decrease it's upper bound (eg, 40..59 or 20..40) and try again. Repeat until you've found the offending block of regions. By using a binary search pattern, the problem can usually be found fairly quickly.

Occasionally, you may be unlucky and have two or more widely separated problem regions, in which case iteratively hand modify the exclusion vector (using, say, stack) to identify the problem regions. I've only had to do this a couple of times.

As you can hopefully see in the image below, I'd identified the 37th region (region-id 328) as the problem and after only about 5 iterations. I then had a look at the region, couldn't see anything too obvious but just had a play starting with the 'result' section as that contained an error description. Et, Voilà!

xmcd+recovery+v2%282%29+B.jpg

Stuart

Werner_E
25-Diamond I
(To:StuartBruff)

Thanks for the thoroughly explanations.

I've read quite often here in the forum/collab about your file but didn't pay much attention as I never was in the bad situation of being confronted with a corrupts worksheet. I bet I have you file already two or three times on my harddisk but wouldn't be able to find it when in need for it. The only data loss I ever had with Mathcad was forgetting the passwort for locked regions in a Mathcad14 file and not having a passwordless backup. I had to recreate the sheet then. Thats learning to pay attention the hard way.

StuartBruff
23-Emerald III
(To:Werner_E)

No problem. Even I've forgot about recovery worksheet's existence - it's usually somebody else who remembers it. However, as I and several others have remarked, it's the kind of thing that Mathcad should do automatically, ie make a best attempt at recovery and perhaps annotate the offending regions / be more explicity about what's wrong.

Stuart

Werner_E
25-Diamond I
(To:StuartBruff)

StuartBruff schrieb:

However, as I and several others have remarked, it's the kind of thing that Mathcad should do automatically, ie make a best attempt at recovery and perhaps annotate the offending regions / be more explicity about what's wrong.

I would strongly second that!

klajditp
5-Regular Member
(To:Werner_E)

Can you please try to open this file. i think i have the same problem. I can not lose this file, i have some important info for mu diploma there. Pls anyone help!!

LucMeekes
23-Emerald III
(To:klajditp)

MJG
18-Opal
18-Opal
(To:klajditp)

See attached file.  I noted the area where I had to remove some XML code on page 6.

Announcements

Top Tags