title: How to generate XML for label to print in Javascript using DYMO Connect for Desktop
body: <p>I manage to print a label from DYMO Connect for Desktop v1.3.1. Now I am trying to print the same label using Javascript. The example <a href="http://www.labelwriter.com/software/dls/sdk/samples/js/PrintMeThatLabel/PrintMeThatLabel.js" rel="nofollow noreferrer">PrintMeThatLabel.js</a> is a great example. It contains three different label designs in XML. However, I would like to use the design I created wtih DYMO Connect for Desktop. When I try to use the Dymo file (which is an XML file with extension ".dymo") that was saved with DYMO Connect, I get the following error message if I load it with <code>dymo.label.framework.openLabelXml()</code>:</p>
  
  <pre><code>{"message":"An error has occurred.","exceptionMessage":"'Element' is an invalid XmlNodeType. Line 22, position 4.","exceptionType":"System.Xml.XmlException","stackTrace":"   at System.Xml.XmlReader.ReadEndElement()\r\n   at DYMO.LabelAPI.DYMOLabel`1.Deserialize(XmlReader reader)\r\n   at DYMO.CrossPlatform.Common.Helpers.SerializationHelper.Deserialize[T](XmlReader reader)\r\n   at DYMO.LabelAPI.LabelHelper.ReadAndOpenLabel(XmlReader reader)\r\n   at DYMO.LabelAPI.LabelHelper.OpenLabel(XmlReader reader)\r\n   at DymoSDK.Implementations.DymoLabel.LoadLabelFromXML(String xmlContent)\r\n   at DYMOWebApi.Windows.Controllers.DymoDLSSDKController.GetListLabelsFromSetXML(String labelXml, String labelSetXml)\r\n   at DYMOWebApi.Windows.Controllers.DymoDLSSDKController.PrintLabel2(FormDataCollection formDataCollection)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.&lt;&gt;c__DisplayClass6_2.&lt;GetExecutor&gt;b__2(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.&lt;InvokeActionAsyncCore&gt;d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ActionFilterResult.&lt;ExecuteAsync&gt;d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.&lt;SendAsync&gt;d__15.MoveNext()"}: 
      at Td (DYMO.Label.Framework.3.0.js:61)
      at ae (DYMO.Label.Framework.3.0.js:66)
      at be.printLabel2 (DYMO.Label.Framework.3.0.js:67)
      at Object.printLabel2 (DYMO.Label.Framework.3.0.js:101)
      at oe (DYMO.Label.Framework.3.0.js:126)
      at qe (DYMO.Label.Framework.3.0.js:129)
      at Y.G (DYMO.Label.Framework.3.0.js:74)
      at printLabel (207:608)
      at startupCode (207:617)
      at DYMO.Label.Framework.3.0.js:110
  </code></pre>
  
  <p>If I use <code>openLabelFile</code> instead of <code>openLabelXml</code> I get this error in the console:</p>
  
  <pre><code>Uncaught Error: "Illegal characters in path."
  
  "Illegal characters in path.": 
      at Td (DYMO.Label.Framework.3.0.js:61)
      at ae (DYMO.Label.Framework.3.0.js:66)
      at be.openLabelFile (DYMO.Label.Framework.3.0.js:67)
      at Object.openLabelFile (DYMO.Label.Framework.3.0.js:101)
      at Object.openLabelFile (DYMO.Label.Framework.3.0.js:122)
      at printLabel (207:595)
      at startupCode (207:617)
      at DYMO.Label.Framework.3.0.js:110
      at e (DYMO.Label.Framework.3.0.js:115)
      at cd.&lt;anonymous&gt; (DYMO.Label.Framework.3.0.js:62)
  </code></pre>
  
  <p>The XML in the file from DYMO Connect looks very different from the XML of the label designs in <code>PrintMeThatLabel.js</code>. Can anyone help me?</p>