G
Guest
Hello,
I was wondering if there is a way to have the contents of an XML element
that contains HTML to be deserialized into the cooresponding string property
without the HTML tags being surronded by CDATA?
<?xml version="1.0" encoding="UTF-8" ?>
<introduction>
<header>
<h1>Helping you achieve the natural look you want</h1>
</header>
<text>
<p> The comprehensive resource connecting you with reliable
infor..</p>
</text>
</introduction>
Deserialize into:
[System.Xml.Serialization.XmlRootAttribute(ElementName=Constant.IntroductionElement, Namespace = "", IsNullable = false) ]
public class Introduction
{
//Private variables.
private string _header = string.Empty;
private string _text = string.Empty;
[System.Xml.Serialization.XmlElementAttribute(Constant.HeaderElement)]
public string Header
{
get
{
return this._header;
}
set
{
this._header = value;
}
}
[System.Xml.Serialization.XmlElementAttribute(Constant.TextElement)]
public string Text
{
get
{
return this._text;
}
set
{
this._text = value;
}
}
}
I want the properties of the above class when returned to contain the HTML
tags but I cannot use CDATA around those tags.
Any help will be very much appreciated.
Thanks,
Ken
I was wondering if there is a way to have the contents of an XML element
that contains HTML to be deserialized into the cooresponding string property
without the HTML tags being surronded by CDATA?
<?xml version="1.0" encoding="UTF-8" ?>
<introduction>
<header>
<h1>Helping you achieve the natural look you want</h1>
</header>
<text>
<p> The comprehensive resource connecting you with reliable
infor..</p>
</text>
</introduction>
Deserialize into:
[System.Xml.Serialization.XmlRootAttribute(ElementName=Constant.IntroductionElement, Namespace = "", IsNullable = false) ]
public class Introduction
{
//Private variables.
private string _header = string.Empty;
private string _text = string.Empty;
[System.Xml.Serialization.XmlElementAttribute(Constant.HeaderElement)]
public string Header
{
get
{
return this._header;
}
set
{
this._header = value;
}
}
[System.Xml.Serialization.XmlElementAttribute(Constant.TextElement)]
public string Text
{
get
{
return this._text;
}
set
{
this._text = value;
}
}
}
I want the properties of the above class when returned to contain the HTML
tags but I cannot use CDATA around those tags.
Any help will be very much appreciated.
Thanks,
Ken