Note that there are some explanatory texts on larger screens.

plurals
  1. POSet XML serialziation resulting doc root
    primarykey
    data
    text
    <p>I've got another problem (which might not be an issue in terms of coding problems) but more of principle..been bugging me for a while. I have this c# class, as follows:</p> <pre><code>namespace SMCProcessMonitor { public class Config { [XmlElement("Recipient")] public string recipient; [XmlElement("Server-port")] public int serverport; [XmlElement("Username")] public string username; [XmlElement("Password")] public string password; [XmlElement("Program")] public List&lt;Programs&gt; mPrograms = new List&lt;Programs&gt;(); [Serializable] [XmlRoot("Email-Config")] public class Email { public string Recipient { get { return SMCProcessMonitor.ConfigManager.mConfigurations.recipient; } set { SMCProcessMonitor.ConfigManager.mConfigurations.recipient = value; } } public int ServerPort { get { return SMCProcessMonitor.ConfigManager.mConfigurations.serverport; } set { SMCProcessMonitor.ConfigManager.mConfigurations.serverport = value; } } public string Username { get { return SMCProcessMonitor.ConfigManager.mConfigurations.username; } set { SMCProcessMonitor.ConfigManager.mConfigurations.username = value; } } public string Password { get; set; } } } </code></pre> <p>I can serialize this almost fine. (i recently changed simple get; set; to the full-works as seen above, but when serialising i get something like this;</p> <pre><code>&lt;Config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; &lt;Recipient&gt;sd&lt;/Recipient&gt; &lt;Server-port&gt;1234&lt;/Server-port&gt; &lt;Username&gt;dk&lt;/Username&gt; &lt;Password&gt;kdkdk&lt;/Password&gt; &lt;/Config&gt; </code></pre> <p>Basically I want to wrap these 4 tags in an "email-settings" tag.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload