Hello,
I am creating a custom CMS for a client, and am posting the data of an FCKEdit enabled form to an xml file. The submission works correctly, but when I extract the data back out, it is showing all of the <html> tags, instead of rendering them.
For example text will come out like this : <b><font size="2">sample text</font></b>
Instead of this: sample text
This is because the data is being submitted to my file using "&lt;p&gt;" style tags. The problem is that I want to show the formatting when I extract it again, it doesn't format, but instead show the tags, as if it were the sourcecode. The format I am extracting the data in is as a DataList using ASP.NET 2.0.
This is what my xml file submission code looks like (C#)
------------------------------------------------------------------------------------------------------------------------
// Open an XML document.
System.Xml.XmlDocument myXmlDocument = new System.Xml.XmlDocument();
myXmlDocument.Load(Server.MapPath("~/App_Data/newsitems2.xml"));
System.Xml.XmlNode myXmlNode = myXmlDocument.DocumentElement.FirstChild;
// Create a new XML element and populate its attributes
System.Xml.XmlElement myXmlElement = myXmlDocument.CreateElement("NewsItem");
myXmlElement.SetAttribute("Title", Server.HtmlEncode(txtJobTitle.Text));
myXmlElement.SetAttribute("Paragraph1", Server.HtmlEncode(FCKeditor1.Value.ToString()));
myXmlElement.SetAttribute("Paragraph2", Server.HtmlEncode(FCKeditor2.Value.ToString()));
myXmlElement.SetAttribute("date", DateTime.Now.ToString());
//myXmlElement.InnerText = Server.HtmlEncode(Message.Text);
// Insert the new element into the XML tree and save
myXmlDocument.DocumentElement.InsertBefore(myXmlElement, myXmlNode);
myXmlDocument.Save(Server.MapPath("~/App_Data/newsitems2.xml"));[/i]
------------------------------------------------------------------------------------------------------------------------
So as I said, it is submitting the data correctly, but I want it to submit the actualy HTML, not the "&lt;p&gt;" style tags. Any ideas on how to get the data working properly?
Thanks,
Brandon
I am creating a custom CMS for a client, and am posting the data of an FCKEdit enabled form to an xml file. The submission works correctly, but when I extract the data back out, it is showing all of the <html> tags, instead of rendering them.
For example text will come out like this : <b><font size="2">sample text</font></b>
Instead of this: sample text
This is because the data is being submitted to my file using "&lt;p&gt;" style tags. The problem is that I want to show the formatting when I extract it again, it doesn't format, but instead show the tags, as if it were the sourcecode. The format I am extracting the data in is as a DataList using ASP.NET 2.0.
This is what my xml file submission code looks like (C#)
------------------------------------------------------------------------------------------------------------------------
// Open an XML document.
System.Xml.XmlDocument myXmlDocument = new System.Xml.XmlDocument();
myXmlDocument.Load(Server.MapPath("~/App_Data/newsitems2.xml"));
System.Xml.XmlNode myXmlNode = myXmlDocument.DocumentElement.FirstChild;
// Create a new XML element and populate its attributes
System.Xml.XmlElement myXmlElement = myXmlDocument.CreateElement("NewsItem");
myXmlElement.SetAttribute("Title", Server.HtmlEncode(txtJobTitle.Text));
myXmlElement.SetAttribute("Paragraph1", Server.HtmlEncode(FCKeditor1.Value.ToString()));
myXmlElement.SetAttribute("Paragraph2", Server.HtmlEncode(FCKeditor2.Value.ToString()));
myXmlElement.SetAttribute("date", DateTime.Now.ToString());
//myXmlElement.InnerText = Server.HtmlEncode(Message.Text);
// Insert the new element into the XML tree and save
myXmlDocument.DocumentElement.InsertBefore(myXmlElement, myXmlNode);
myXmlDocument.Save(Server.MapPath("~/App_Data/newsitems2.xml"));[/i]
------------------------------------------------------------------------------------------------------------------------
So as I said, it is submitting the data correctly, but I want it to submit the actualy HTML, not the "&lt;p&gt;" style tags. Any ideas on how to get the data working properly?
Thanks,
Brandon
Re: Post data in HTML Format with XML
disable-output-escaping="yes"
in your <xsl:value-of select="..." tag that displays the text that should be rendered in HTML