I don't understand why only the first "inner node" of the element gets deserialized into model.Description. How do I need to set up the Description node of the C# Body class so that all of the text between and gets assigned to the Description element?
Code:
class Program
{
static void Main(string[] args)
{
try
{
var xDoc = XDocument.Load("xmlModel.xml");
model.Body model = null;
var xmlSerializer = new XmlSerializer(typeof(model.Body));
using (var reader = xDoc.CreateReader() )
{
model = (model.Body)xmlSerializer.Deserialize(reader);
}
Console.Write(model.Description);
}
catch (System.Xml.XmlException e)
{
Trace.TraceWarning("XML Parse Error: xmlModel.xml, line " + e.LineNumber + ", position " + e.LinePosition + "\n" + e.Message);
}
}
}
Model:
namespace model
{
[XmlRoot("body")]
public class Body
{
[XmlElement("description")]
public String Description { get; set; }
[XmlElement("address")]
public String UnitAddress { get; set; }
}
}
XML:
<?xml version="1.0" encoding="utf-8" ?>
<body>
<description>
<p>The PGT has 10 user-accessible 32-bit registers, which are used to configure,
operate, and monitor the state of the PGT.
</p>
<p>
An IP bus write access to the PGT Control Register (PGT_CR) and the GPT Output Compare
Register1 (PGT_OCR1) results in <i>one cycle of wait state</i><ph audience="internal"> (ips_xfr_wait high for 1 cycle)</ph>, while other valid IP bus accesses incur 0
wait states.
</p>
<p>
Irrespective of the Response Select <ph audience="internal">(resp_sel) </ph>signal
value, a Write access to the PGT Status Registers (Read-only registers PGT_ICR1,
PGT_ICR2, PGT_CNT) will generate a bus exception<ph audience="internal"> (ips_xfr_err signal will be asserted)</ph>.
</p>
<ul>
<li>
If the Response Select <ph audience="internal">(resp_sel) </ph>signal is driven Low, then the Read/Write access to the <i>unimplemented</i> address space of PGT (<i>ips_addr</i> is greater than or equal to $BASE + $028) will generate a bus exception<ph audience="internal"> (ips_xfr_err signal will be asserted)</ph>.
</li>
<li>
If the Response Select <ph audience="internal">(resp_sel) </ph>is driven High, then the Read/Write access to the unimplemented address space of PGT will <i>not</i> generate any error response (like a bus exception).
</li>
</ul>
</description>
<address>0x0000</address>
</body>
Thanks a ton, Chris