Problem import SuperMemo CE XML file into SuperMemo 2004
problem
I've been successfully exporting and importing XML learning data between SuperMemo 2004 and SuperMemo CE for a long time, but this morning it didn't work. After clicking on Tools | Import | Learning Process | XML file on the desktop and choosing the XML file I exported from SuperMemo CE, I immediately get this error: "This file does not form a correct SuperMemoElement tree structure"
I've tried restarting programs and rerunning the export from SuperMemo CE, but I still get the same error. I inspected the XML file by hand and it is not obviously corrupted. I can't think of anything else to try. Is this a known problem. Is there a solution? This seems like a bug to me. I'd be willing to send my data files as necessary to try and reproduce this problem. Right now I'm stuck without the ability to sync my data! Frustrating.
Cheers, Ben
SuperMemo 2004 (Build 12.06, Apr 4, 2005) SuperMemo CE 3.50 Date: 2005-07-07
SuperMemo Report
Activity: Importing from C:\Documents and Settings\Ben\My Documents\Pocket_PC My Documents\SuperMemo\Out.xml Collection: C:\Documents and Settings\Ben\My Documents\SuperMemo\Full Collection Date: Thursday, March 15, 2007, 8:47:42 AM SuperMemo 2004 (Build 12.06, Apr 4, 2005)
++++++++++++++++++++++ ERROR #1 ++++++++++++++++++++++
This file does not form a correct SuperMemoElement tree structure Please inspect the file for damaged content
XML UPDATE STATISTICS:
New elements added: 0 Learning updated: 0 Texts updated: 0
Process completed at 8:47:42 AM in 00:00:00 sec (Thursday, March 15, 2007)
ONE ERROR
Idea
See if this XML file is not too large. (optionally: see at its bottom if the root tag is closed (as compared with shorter files)).
Response
File size is 555KB and ends like this. I can't figure out how to attach a file in the Wiki, but can send to a separate e-mail address if necessary.
</SuperMemoElement> <SuperMemoElement> <ID>4342</ID> <Type>Item</Type> <Content> <Question><A name=477-2786><STRONG>Question</STRONG></A><STRONG>:<BR></STRONG>If I have read a paragraph from an article and set a read-point, will SuperMemo automatically modify element's A-factor with a new value (i.e. the length of the whole article minus the length of the paragraph I have just read)<BR><B>Answer:<BR></B>No. Text length is only used to heuristically propose an A-Factor at import time to free the user from the need to think about A-Factors. The "intensity of reading" will provide a way of prioritizing on its own: the faster you read, the lesser the chance your article will drift to remote intervals. However, once you use <I>Ctrl+Shift+R</I> or <I>Ctrl+J</I> to reschedule the article (e.g. if its interval increases too fast), SuperMemo will notice that action and adjust A-Factor accordingly. Naturally, there is no hard science behind those adjustments. They have been worked out by trial and error. It is also up to the user to get "the feel" of incremental reading to truly understand the consequences of reading vs. postponing a given piece of material</Question> <Answer></Answer> </Content> <LearningData> <Interval>2</Interval> <Repetitions>4</Repetitions> <Lapses>0</Lapses> <LastRepetition>13.03.2007</LastRepetition> <AFactor>1.627</AFactor> <UFactor>1.450</UFactor> </LearningData> </SuperMemoElement> </SuperMemoCollection>
Solution?
It seems the file is too big for MSXML.dll to handle (it looks like terminated correctly but its size is huge). Consider exporting your collection as two separate subsets.
Perhaps Microsoft provides some info on the maximum size of XMLs handled by MSXML. It might be memory-dependent. Then adding memory could solve the problem??
if you want to send this file use BUG at SUPERMEMO dot COM, but it is unlikely SuperMemo can overcome limits imposed by an MS software
Real Solution
The problem has nothing to do with file size. I think 555KB is large, but hardly large enough to crash the parser.
I figured out the problem by opening the XML file in Firefox which gave me the line number of the parsing errors. Two of my entries had Unicode quoting characters (�) that caused parsing errors. When I deleted the offending characters, the file imported with no problems. I'm not sure what the correct resolution is for this problem, but either SuperMemo 2004 shouldn't place these characters in the original XML or SuperMemo CE shouldn't export them.
question
could you paste the offending fragment here (as HTML):
<SuperMemoElement> <ID>4261</ID> <Type>Item</Type> <Content> <Question>� Apply loop distribution (also called loop fission or loop<BR>splitting): a technique used in the context of software<BR>compilation with other goals (e.g., for parallelization,<BR>register pressure reduction, and cache hit/miss ratio<BR>improvement) [10][11];<BR></Question> <Answer></Answer> </Content> <LearningData> <Interval>7</Interval> <Repetitions>3</Repetitions> <Lapses>0</Lapses> <LastRepetition>12.03.2007</LastRepetition> <AFactor>1.490</AFactor> <UFactor>1.402</UFactor> </LearningData> </SuperMemoElement>
The error Firefox gave was:
XML Parsing Error: not well-formed Location: file:///C:/Documents%20and%20Settings/Ben/My%20Documents/Pocket_PC%20My%20Documents/SuperMemo/Out.xml Line Number 10441, Column 17: <Question>� Apply loop distribution (also called loop fission or loop<BR>splitting): a technique used in the context of software<BR>compilation with other goals (e.g., for parallelization,<BR>register pressure reduction, and cache hit/miss ratio<BR>improvement) [10][11];<BR></Question> ----------------^