Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error generating the XML document.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Error generating the XML document.

    Searching the forum, this seems to be a common issue...

    Context: I'm in the process of converting an indicator I developed for NT7 to NT8.
    In the NT7 version I had to specify serialization instructions for both Color and Font objects.

    I have converted my NT7 Font parameters to NT8 SimpleFont parameters.
    Do I need to specify serialization instructions for the NT8 SimpleFont objects as I had to for the NT7 version?

    I have converted my NT7 Color parameters to NT8 SolidColorBrush parameters, and followed the "Saving a Brush as a user defined property (Serialization)" guideline in http://ninjatrader.com/support/helpG...s/?brushes.htm as follows:

    [Browsable(false)]
    [XmlIgnore()]
    public SolidColorBrush MyColor
    {
    get { return myColor; }
    set { myColor = value; }
    }
    [Browsable(false)]
    public string MyColorSerialize
    {
    get { return Serialize.BrushToString(myColor); }
    set { myColor = (SolidColorBrush)Serialize.StringToBrush(value); }
    }

    Compiles and executes fine.
    But I continue to get "Could not save indicator...There was an error generating the XML document."

    A suggestion... it would be extremely helpful if NT log and trace files would actually report the specific culprit. In the absence of this, can anyone offer any advice on how to find the objects causing the XML document generation failure?

    #2
    Hello,

    Thank you for the question.

    I have put in a feature request for further logging on serialization exceptions.

    As for finding the cause of these items, in general I would suggest only to know when to do this and when not to do this in your coding and that would resolve the concern. There is not a specific guide on what can or can not be serialized, in general most complex objects would require you to do the process you have described though.

    Another general rule to follow would be after creating any new public properties in the script, just test it quickly by applying it to a chart and restart the platform saving the workspace. If the item returns as you had left it with no errors in the control center log window, there is no serialization needed.

    Please let me know if I may be of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Just after posting this thread, I realized I had failed to re-apply the very last compiled change to the chart before attempting to save the workspace.... oops. As I thought I read in another post, I see we do not need to specify serialization instructions for the NT8 SimpleFont objects.

      In any case, I do think logging the exceptions would still be beneficial.
      Thanks Jesse!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by GussJ, 03-04-2020, 03:11 PM
      11 responses
      3,221 views
      0 likes
      Last Post xiinteractive  
      Started by andrewtrades, Today, 04:57 PM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by chbruno, Today, 04:10 PM
      0 responses
      7 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Started by josh18955, 03-25-2023, 11:16 AM
      6 responses
      438 views
      0 likes
      Last Post Delerium  
      Started by FAQtrader, Today, 03:35 PM
      0 responses
      9 views
      0 likes
      Last Post FAQtrader  
      Working...
      X