--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
There's no direct XML relationship to protobuf. Any available tooling will relate to your local platform / language / runtime / etc.As it happens, I do this regularly in .NET using protobuf-net and XmlSerializer (the inbuilt .NET xml serializer) - which works great because protobuf-net has been designed to work with similar idioms. This, however, is a different API to the more typical Java / C++ etc clients, and I can' t comment on how easy it would be to serialize those as xml.The fact that both are tree formats (rather than graph formats) means there aren't any fundamental problems - it is just a case of getting your chosen (and platform specific) xml serializer to understand the map.Marc
--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
--
Regards,
Marc
xmlDoc = new XPathDocument(memoryStream);c}}return xmlDoc;
}--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/protobuf/-/E_KNwOPbenoJ.
Hey All;
Regression testing framework based on protobuf serialization format.
What does the framework need to achieve?
1. Record testing cases and save them as protobuf in file.2. Read testing cases from file by protobuf format.
3. Run testing cases, save the result in file by protobuf format, when all cases running over, then compare all the results with the expected ones which are also saved in file as protobuf format.
To achieve the above goals, I have the following questions.
1. Is protobuf comparable? On file it saves in binary format, how to compare? Since we need to show the differences to developer?
2. If we append all testing cases in one file, how to recover it?
3. …
The background is that my project uses XML as data serialization before, but now we replace it by protobuf, of course the testing framework should also change, but if change to protobuf, seems many tough problems need to fix.
Possibly google has perfect solutions for the above issues, anybody who has the idea please attend and discuss, thanks all your help in advance.
To unsubscribe from this group, send email to protobuf+unsub...@googlegroups.com.
option optimize_for = SPEED;
//*************************
message Test {
repeated A a = 1;
}
message A {
required string str = 1;
}using System;
using System.Collections.Generic;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
using System.Xml.XPath;
using ProtoBuf;
using TestMsg;
namespace protocolbufferserialize
{
class Program
{
static void Main(string[] args)
{
Test t = new Test();
XPathDocument xmldoc = Serialize(t);
Test t1 = Serialize(xmldoc);
}
public static XPathDocument Serialize(Test wro)
{
XPathDocument xmlDoc = null;
Serializer.PrepareSerializer<Test>();
XmlSerializer x = new XmlSerializer(wro.GetType());
using (MemoryStream memoryStream = new MemoryStream())
{
using (TextWriter w = new StreamWriter(memoryStream))
{
x.Serialize(w, wro);
memoryStream.Position = 0;
xmlDoc = new XPathDocument(memoryStream);
}
}
return xmlDoc;
}
public static Test Serialize(XPathDocument xmlDoc)
{
Test t = null;
Serializer.PrepareSerializer<Test>();
XmlSerializer x = new XmlSerializer(xmlDoc.GetType());
using (MemoryStream memoryStream = new MemoryStream())
{
using (TextWriter w = new StreamWriter(memoryStream))
{
x.Serialize(w, xmlDoc);
memoryStream.Position = 0;
t = Serializer.Deserialize<Test>(memoryStream);
}
}
return t;
}
}
}
Thanks for your quick response.
Seems no easy and convenient solution for managed C++ which I mean it isn’t
dependent on MS .NET framework.
If no such convert plug-in available, boost serialization and TinyXML are all my choice.
If using boost, it is intrusive
for original class, now I am responsible for a regression testing framework,
using XML for object serialization, the developing language is C++, seems
they are all not easy to achieve the goal, the last choice is TinyXML, it
could do, despite that many code need to written by myself for many
classes.
Hope to get more of your tips. Thanks.
When you say managed C++ what kind of library are you using? A C++ one? Can't you wrap that in a Managed C++ layer?
--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/protobuf/-/S6tfdGgl6IsJ.
Have you tried http://code.google.com/p/protostuff/ ?
--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/protobuf/-/hTS8SDZLVvgJ.