Mombu the Programming Forum

Go Back   Mombu the Programming Forum > Programming > Write a XML file without accents
User Name
Password
REGISTER NOW! Mark Forums Read




Reply
1 25th March 14:41
tmachado
External User
 
Posts: 1
Default Write a XML file without accents



Hello,

I have a problem and I think that someone can help me.

I am writing a XML file using data from a Oracle data base. I am from
Brazil, and here we have accents on the words, like "acentuação".I need write
my XML file without the accents. Today I am using one DataSet to write my
XML, specifically the method WriteXml.

How can I resolve my problem, using a feature from the .NET Framework?

Thank's

--
Tiago Machado
Microsoft Certified Professional C# .NET
  Reply With Quote


 


2 28th September 16:10
senol
Miembro
Mombu User
 
Join Date: Sep 2008
Location: TURKEY
Posts: 1
senol is on a distinguished road
Default Re: Write a XML file without accents



using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Text;
using System.Xml;

DataView XmlSag = personel_kontrol.Toplam_kayitlar("select * from User_Haber where HResim_Yer='2' and Haber_Durum='Evet' and DilID='Tr'");
XmlTextWriter writer = new XmlTextWriter(Server.MapPath("../bigsale.xml"), System.Text.Encoding.UTF8);

writer.WriteStartDocument();

writer.WriteComment("The Program Özel Bilgi İşlem A.Ş");

writer.Formatting = Formatting.Indented;


writer.WriteStartElement("bigSale");

for (int FlasId = 0; FlasId < XmlSag.Count; FlasId++)
{

//writer.WriteElementString("image", null);
//writer.WriteAttributeString("picUrl", "Haber/" + XmlSag[FlasId]["DilID"].ToString() + "/Resimler/" + XmlSag[FlasId]["Haber_Resim"].ToString());
//writer.WriteAttributeString("linkUrl", "Yonlendir.aspx?ID=" + XmlSag[FlasId]["DilID"].ToString());
//writer.WriteAttributeString("title", XmlSag[FlasId]["Haber_Tarih"].ToString());


writer.WriteStartElement("image", null);
writer.WriteAttributeString("picUrl", "Yonetici/Haber/" + XmlSag[FlasId]["DilID"].ToString() + "/Resimler/" + XmlSag[FlasId]["Haber_Resim"].ToString());
writer.WriteAttributeString("linkUrl", "haber.aspx?Haber=" + XmlSag[FlasId]["HaberID"].ToString());
writer.WriteAttributeString("title", XmlSag[FlasId]["Haber_Baslik"].ToString());
writer.WriteEndElement();


}

writer.Flush();
writer.Close();

my free asp.net training video download
senol is offline   Reply With Quote


 


Reply


Thread Tools
Display Modes




666