Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Loadfromxml is not loading xml file (Read 3373 times)
em
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 4
Joined: Jan 17th, 2012
Loadfromxml is not loading xml file
Jan 17th, 2012 at 8:38pm
Print Post  
I am using NetDiagrammer in asp.net. I have added the functionality to allow user to set titles for nodes and arrows. Once everything is set then this diagram is saved in xml format by calling savetoxml method. Later when i try to load this xml file using loadfromxml then I get the following error:-


[FormatException: Input string was not in a correct format.]
MindFusion.Diagramming.Diagram.LoadFromXml(XmlDocument document, Boolean loadDiagramProperties) +2459
MindFusion.Diagramming.Diagram.LoadFromXml(XmlDocument document) +42
MindFusion.Diagramming.WebForms.DiagramView.LoadFromXml(XmlDocument document) +55
MindFusion.Diagramming.WebForms.DiagramView.LoadFromXml(String fileName) +82



Any help would be appreciated.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Loadfromxml is not loading xml file
Reply #1 - Jan 18th, 2012 at 10:52am
Print Post  
Are you storing these titles as Tag values? Could you attach the file here or email it to support@mindfusion.eu?
  
Back to top
 
IP Logged
 
em
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 4
Joined: Jan 17th, 2012
Re: Loadfromxml is not loading xml file
Reply #2 - Jan 18th, 2012 at 6:38pm
Print Post  
No, I am not storing these values as tag values rather I am just setting the text property of each node and link and then call savetoxml method to save it. I am attaching the xml file here.
  

AnotherTest.txt (Attachment deleted)
Back to top
 
IP Logged
 
em
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 4
Joined: Jan 17th, 2012
Re: Loadfromxml is not loading xml file
Reply #3 - Jan 18th, 2012 at 6:57pm
Print Post  
I have figured it out. Actually I am using tag to serialize some information. Once I have removed the tag information then it started working fine. Can you please tell me what is wrong with the following tag information in the file?

<Tag>ModelInformation;54;</Tag>
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Loadfromxml is not loading xml file
Reply #4 - Jan 19th, 2012 at 8:26am
Print Post  
Are you handling the DeserializeTag event, and what does the handler look like?
  
Back to top
 
IP Logged
 
em
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 4
Joined: Jan 17th, 2012
Re: Loadfromxml is not loading xml file
Reply #5 - Jan 19th, 2012 at 2:50pm
Print Post  
No, I was just loading the file without deserializing it. Perhaps, this is a problem. Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Loadfromxml is not loading xml file
Reply #6 - Jan 19th, 2012 at 7:15pm
Print Post  
Our developer reproduced the exception loading the attached file and thinks it happens if you use custom SerializeTag handler without a reciprocal DeserializeTag. The problem is that the standard tag serialization code writes a "Type" attribute, and the deserialization code tries to read that attribute and parse it as an int value. If the <Tag> elements was saved by SerializeTag handler, that attribute is not there and the built-in deserialization code cannot load the tag. So handling DeserializeTag should fix the problem.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint