This xml file is in some ancient XML format of ours, have you used older ActiveX or Windows Forms version to save it? We've added XML serialization in JavaScript library only recently and current official build works with latest format #17 of XML files, yours is <Diagram Version="12">. It happens we've just implemented some backwards compatibility for a client, it seems it can also load your template.xml file as well -
https://mindfusion.eu/_beta/jsdiag271.zipThe build above officially supports versions as old as 13 though, we'll check what differences there are from 12 to it.
Quote:because i load the same in webforms it works just fine
WebForms version already has backwards compatibilty in its .NET LoadFromXml implementation, then it sends contents to client side as JSON.
Quote:If i add Id attribute to <LinkHeadShape> tag, then i get error: Item classId ["ns:CustomNode"] is not registered
The second parameter of that registerClass method is not XML id but fully qualified type name (with added namespace). It doesn't seem we offer public API to register XML identifiers for custom classes directly in JavaScript. For time being you could implement that by replacing following function in Diagram.prototype with your version that adds new identifiers -
var Dictionary = MindFusion.Collections.Dictionary;
registerXmlTypes: function ()
{
var xmlClassMap = new Dictionary();
function register(ctor, classId, classVersion)
{
xmlClassMap[classId] = ctor;
ctor.xmlInfo = { classId: classId, classVersion: classVersion };
}
register(mdiag.DiagramLink, "std:DiagramLink", 2);
register(mdiag.ShapeNode, "std:ShapeNode", 1);
register(mdiag.TableNode, "std:TableNode", 1);
register(mdiag.ContainerNode, "std:ContainerNode", 3);
register(mdiag.SvgNode, "std:SvgNode", 2);
register(mdiag.FreeFormNode, "std:FreeFormNode", 1);
register(mdiag.GlassEffect, "std:GlassEffect", 1);
register(mdiag.AeroEffect, "std:AeroEffect", 1);
return xmlClassMap;
}
Regards,
Slavcho
Mindfusion