Friday

remove namespace xml in serialisation by XmlSerializerNamespaces.dot.net/C#/csharp


 public static string toXML(Object obj)
{
XmlSerializer xmlSerializer = new XmlSerializer(obj.GetType());
StringWriter stringWriter = new StringWriter();
XmlWriterSettings writerSettings = new XmlWriterSettings();
writerSettings.OmitXmlDeclaration = true;
writerSettings.Indent = true;


using (XmlWriter xmlWriter = XmlWriter.Create(stringWriter, writerSettings))
{

// Namespace removed in these two lines:
XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
ns.Add("", "");


xmlSerializer.Serialize(xmlWriter, obj,ns);

}
return stringWriter.ToString();
}

more...

1 comment:

Anonymous said...

mil thks era presisamente o que estaba buscando!!!!

excelente!!!!!

imagemagic add text to image

rem different types of text annotations on existing images rem cyan yellow orange gold rem -gravity SouthWest rem draw text and anno...