Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 184175

Summary: [Model] the new XMLMemento instance don't have the same elements and texts as the last instance
Product: [Eclipse Project] Platform Reporter: Zhang Peng <nemo.zhp>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: eclipse, pwebster, remy.suen
Version: 3.3Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Zhang Peng CLA 2007-04-26 04:49:14 EDT
Build ID: M20060921-0945

Steps To Reproduce:
1.create an XMLMemento instance
2.create elements
3.save the instance into .xml file
Note: i haven't put textData into the memento, but when i save contents of the memento into the file, the system will put '\n' into the file.
4.close the file
5.create a new XMLMemento instance from the .xml file
6.save the new XMLMemento instance.
7.then strange characters appears in the .xml file: &#x0A;

More information:
platform independence:
automatically put '\n' into the .xml file is nice, but the line separator is 0x0D0A in Windows, and it is 0x0D in Unix, so the fix should be platform independence.
we can get this property from System.getProperty("line.separator");
Comment 1 Paul Webster CLA 2007-04-26 07:45:43 EDT
As near as I can see, we do that:
DOMWriter uses println(); which is in PrintWriter and uses line.separator

It might have to do with how the DOM parser reads the XMLMemento back in and then writes it back out.  It must create text nodes for the \n entries when it reads them in, and then when we print it out the second time we use getReplacement(*) and turn \n deliberately into &#x0A; ... 

But I don't think that writing it a 3rd time and reading it in will add mroe ... just leave the x0A entities there from the first time.

PW
Comment 2 Susan McCourt CLA 2009-07-09 19:20:09 EDT
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009
Comment 3 Eclipse Genie CLA 2020-01-08 13:21:52 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.