I'm using groovy.xml.MarkupBuilder to create XML response but it creates prettyprinted result which is unneeded in production.
def writer = new StringWriter()
def xml = new MarkupBuilder(writer)
def cities = cityApiService.list(params)
xml.methodResponse() {
resultStatus() {
r...
This is killing me. I've read these:
http://msdn.microsoft.com/en-us/library/athddy89(v=VS.80).aspx
http://msdn.microsoft.com/en-us/library/2baksw0z(v=VS.80).aspx
But I don't see how to apply them to what I'm trying to do. I want to customize the way the following list serializes...
[Serializable]
public class FinalConcentrations :...
Hi,
I'm trying to serialize an object which contains an object which implements IEnumerable<>. The last object also contains an object which implements IEnumerable<>. The objects strucutre is as followed:
[Serializable]
public class A
{
public B _b {get; set; }
}
[Serializable]
public class B : IEnumerable<C>
{
public Lis...
One problem bugged me enough to register on stackoverflow. Currently if I want to serialize Color to XML string as named color, or #rrggbb, or #aarrggbb, i do it like this:
[XmlIgnore()]
public Color color;
[XmlElement(ElementName = "Color")]
public String color_XmlSurrogate
{
get { return MyColorConverter.SetColor(color); }
set { ...
I have a base class ("MyBaseClass") in a project called "BaseFramework" which is included in several solutions within the company. There are several derived class's in various projects throughout the company that inherit from "MyBaseClass". If I then create a List and add derived class's to it, it will not serialize. I realise that if I...
Is it possible that DataContractSerializer wrongly deserializes object if fields are not in the "correct" (whatever that means) order? My classes that I serialize/deserialize do not have order attributes placed on fields/properties. Yet one of my fields always get deserialized as null although it has values, it actually contains a list o...
I have an existing class for serializing and deserializing objects to/from XML. It's a generic class with a single type parameter T whose only constraint is where T : IXmlSerializable. However, I want to still be able to use this class on classes that do not implement IXmlSerializable but have the [Serializable] attribute. How could I...
Hi folks,
I have an iPhone App that uses a relatively small amount of data.
I'd like to save the data in the XML format and be able to load this in memory to Objective-C objects. I'd like to use iPhone SDK facilities like NSPropertyListSerialization or writeToFile:atomically: classes and methods.
The NSPropertyListSerialization documen...
I need to use Python 2.4.4 to convert XML to and from a Python dictionary. All I need are the node names and values, I'm not worried about attributes because the XML I'm parsing doesn't have any. I can't use ElementTree because that isn't available for 2.4.4, and I can't use 3rd party libraries due to my work environment. What's the easi...
I have a class in my C# project marked with the [Serializable] attribute. It has a property of type RSAKeyValue:
[XmlElement(PUBLIC_KEY_TAG_NAME)]
public RSAKeyValue Key { get; private set; }
When I try to serialize an instance of my class to XML and then deserialize that XML back to an instance of my class, I get:
System.Invalid...
Hi
I have some XML Serialization and it works on my local machine but when I put it up on my hosting company and try it out it fails.
I don't know why
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Plea...
hi there,
I have a web service. A method of this web service, returns WSSonuc class.
[Serializable]
public class WSSonuc
{
public int M_Durum { get; set; }
public object M_SonucNesne { get; set; }
}
this is my Web service method:
[WebMethod]
[SoapHeader("_ticket", Direction = SoapHeaderDirection.InOut)]
public WSSonuc f...
Hi guys,
I have a system that entities (from database, represented as Java objects through ORM) will be read by XML-RPC clients, my existing way is to serialize them via a StructSerializer, which in its code, we read properties out from the Java object, including calling another StructSerializer to serialize/parse a property, e.g.
Surr...
I want to generate a XML String for a given object. What is the best API to serialize an object to XML String using Java 1.4?
Thanks,
RT
...
I'm having a time deciding on a direction to go with a class lib I'm building.
I have a batch of industry standard XSD's, from which I'm generating .net objects. I;ve used all of XSD.exe, LinqtoXsd, xsd2code, and even OxmLibrary with varying results. But in the end, I am able to generate decent .net classes which can be serialized/dese...
Hey Everyone,
I've got a collection of around 20,000 objects that need to get persisted to my database. Now, instead of doing 20,000 insert statements, I want to pass all the records in using an XML parameter.
As far as serializing the object and passing it into the procedure goes, I'm all set. However, I'm wondering if anyone has an...
I am working on an Android application that is required to connect to a REST WebService. There are a number of requests that the application needs to make and the request format is XML. What I have done presently is create a Request template per XML request using StringBuilder class and substitute a placeholder String for different value...
I want XML in the following format:
<configuration><!-- Only one configuration node -->
<logging>...</logging><!-- Only one logging node -->
<credentials>...</credentials><!-- One or more credentials nodes -->
<credentials>...</credentials>
</configuration>
I'm trying to create a class Configuration that has the [Serializable] a...
Is it possible to achieve the following in c#...
for the class below...
public class Foo{
public int BarId{get;set;}
public string BarString{get;set;}
}
I want to achieve the following XML:
<Foo>
<BarId BarString="something">123</BarId>
</Foo>
...
How can I remove the whitespaces and line breaks in an XML string in Python 2.6? I tried the following packages:
etree: This snippet keeps the original whitespaces:
xmlStr = '''<root>
<head></head>
<content></content>
</root>'''
xmlElement = xml.etree.ElementTree.XML(xmlStr)
xmlStr = xml.etree.ElementTree.tostring(xmlElement, ...