Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you run your test XML file through the <code>xsd.exe</code> tool by Microsoft twice, first turning the XML into a XSD (<code>xsd.exe yourfile.xml</code> --> yourfile.xsd), and then generating a C# class from that XSD (<code>xsd.exe /c yourfile.xsd</code> --> yourfile.cs) that can deserialize that XML content, you'll end up with something like this (long and not very pretty.....)</p> <pre><code>//------------------------------------------------------------------------------ // &lt;auto-generated&gt; // This code was generated by a tool. // Runtime Version:2.0.50727.4016 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // &lt;/auto-generated&gt; //------------------------------------------------------------------------------ using System.Xml.Serialization; // // This source code was auto-generated by xsd, Version=2.0.50727.3038. // /// &lt;remarks/&gt; [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)] public partial class EmailConfiguration { private object[] itemsField; /// &lt;remarks/&gt; [System.Xml.Serialization.XmlElementAttribute("BCC", typeof(EmailConfigurationBCC), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] [System.Xml.Serialization.XmlElementAttribute("CC", typeof(EmailConfigurationCC), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] [System.Xml.Serialization.XmlElementAttribute("SendTo", typeof(EmailConfigurationSendTo), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] public object[] Items { get { return this.itemsField; } set { this.itemsField = value; } } } /// &lt;remarks/&gt; [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] public partial class EmailConfigurationBCC { private string addressField; /// &lt;remarks/&gt; [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] public string Address { get { return this.addressField; } set { this.addressField = value; } } } /// &lt;remarks/&gt; [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] public partial class EmailConfigurationCC { private string addressField; /// &lt;remarks/&gt; [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] public string Address { get { return this.addressField; } set { this.addressField = value; } } } /// &lt;remarks/&gt; [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] public partial class EmailConfigurationSendTo { private EmailConfigurationSendToAddress[] addressField; /// &lt;remarks/&gt; [System.Xml.Serialization.XmlElementAttribute("Address", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] public EmailConfigurationSendToAddress[] Address { get { return this.addressField; } set { this.addressField = value; } } } /// &lt;remarks/&gt; [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] public partial class EmailConfigurationSendToAddress { private string valueField; /// &lt;remarks/&gt; [System.Xml.Serialization.XmlTextAttribute()] public string Value { get { return this.valueField; } set { this.valueField = value; } } } </code></pre> <p>I would think this will work - it's not nice, but it'll work. You should be able to convert your complete XML file into a serializable / deserializable C# class that way. Try it!</p> <p>Marc</p>
 

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