Re:Re: Re:Re: [protobuf] Re: Is any method available to convert a protobuf object to XML?

2011-07-06 Thread jianhua
Thanks Wright;
Yes, protostuff has serialize tool for XML, but written by JAVA and my project 
is native C++.  


At 2011-06-27 22:15:48,Ben Wright compuware...@gmail.com wrote:
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 
visithttps://groups.google.com/d/msg/protobuf/-/hTS8SDZLVvgJ.
To post to this group, send email toproto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: Re:Re: [protobuf] Re: Is any method available to convert a protobuf object to XML?

2011-06-27 Thread Lars Schouw
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.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: Re:Re: [protobuf] Re: Is any method available to convert a protobuf object to XML?

2011-06-27 Thread Ben Wright
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.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re:Re: Re:Re: [protobuf] Re: Is any method available to convert a protobuf object to XML?

2011-06-27 Thread jianhua
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.


At 2011-06-27 22:05:18,Lars Schouw sch...@gmail.com wrote:
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 
visithttps://groups.google.com/d/msg/protobuf/-/S6tfdGgl6IsJ.
To post to this group, send email toproto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Is any method available to convert a protobuf object to XML?

2011-06-24 Thread Lars Schouw
Yes, for example in C# you can do like this to create an XPathDocument using 
the protobuf-net lib.

public static XPathDocument Serialize(ProtocolBufferMesage msg)
{
XPathDocument xmlDoc = null;
Serializer.PrepareSerializerTest();

XmlSerializer x = new XmlSerializer(msg.GetType());
using (MemoryStream memoryStream = new MemoryStream())
{
using (TextWriter w = new StreamWriter(memoryStream))
{
x.Serialize(w, msg);
memoryStream.Position = 0;
xmlDoc = new XPathDocument(memoryStream);
}
}
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.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: [protobuf] Re: Is any method available to convert a protobuf object to XML?

2011-06-24 Thread Marc Gravell
The code shown uses XmlSerializer - it doesn't use protobuf-net at all. 
protobuf-net does tend to be friendly towards this, however you would:

- deserialize with protobuf-net into objects
- serialize with XmlSerializer

The only point of co tact between the two is the object model in the middle.

On 24 Jun 2011, at 16:29, Lars Schouw sch...@gmail.com wrote:

 Yes, for example in C# you can do like this to create an XPathDocument using 
 the protobuf-net lib.
 
 public static XPathDocument Serialize(ProtocolBufferMesage msg)
 {
 XPathDocument xmlDoc = null;
 Serializer.PrepareSerializerTest();
 
 XmlSerializer x = new XmlSerializer(msg.GetType());
 using (MemoryStream memoryStream = new MemoryStream())
 {
 using (TextWriter w = new StreamWriter(memoryStream))
 {
 x.Serialize(w, msg);
 memoryStream.Position = 0;
 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.
 To post to this group, send email to protobuf@googlegroups.com.
 To unsubscribe from this group, send email to 
 protobuf+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/protobuf?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.