We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

write ML file

hi
I want to write a program that creates xml file from my diagram....
I used SaveSoap, but its not my require.
I need a program that works revers the ORGLAYOUT sample....
at the other hand i need to create a xml file with multi columns as parentNode and ChildNods ....
plz help me
thanx

2 Replies

J. J.Nagarajan Syncfusion Team October 23, 2007 04:10 AM UTC

Hi Alex ,

Kindly accept our sincere apologies for the delay in getting back to you.

The LoadSOAP and SaveSOAP methods use the SOAP XML format to serialize diagrams to files and I / O streams. Please refer to the following code snippet

[C#]
//To save the diagram in Xml format.

this.diagram1.SaveSoap( string FileName);

//To load the diagram in Xml format.

this.diagram1.LoadSoap( string FileName);

I have attached the sample for your reference. In this sample when you click on File->save menuitem you can save the diagram in xml file. When you click on File->open menuitem you can load the diagram from the xml file.

http://websamples.syncfusion.com/samples/Diagram.Windows/F68983/main.htm

Please refer to the sample and let me know if this helps.

Regards,
Nagaraj


J. J.Nagarajan Syncfusion Team November 24, 2007 03:15 AM UTC

Hi Alex ,

Kindly accept my sincere apologies for the delay in getting back to you.

If your intention is to write the label's text in Xml writter then please refer to the following code snippet.

[C#]

XmlTextWriter textWriter = new XmlTextWriter("..\\..\\myXmFile.xml", Encoding.Unicode);

foreach (INode node in this.diagram.Model.Nodes)
{
if (node is RoundRect)
{
RoundRect rect = node as RoundRect;

textWriter.WriteStartElement("Employees");

textWriter.WriteStartElement("Name");
textWriter.WriteString(rect.Labels[0].Text);
textWriter.WriteEndElement();

textWriter.WriteStartElement("EmployeeID");
textWriter.WriteString(rect.Labels[1].Text);
textWriter.WriteEndElement();

textWriter.WriteEndElement();

}
}
textWriter.Close();


I have attached the sample for your reference.

http://websamples.syncfusion.com/samples/Diagram.Windows/F68983_Nov23/main.htm

Please refer to it and let me know if this helps.

Regards,
Nagaraj


Loader.
Live Chat Icon For mobile
Up arrow icon