Again, I'm not entirely sure what XML <-> .proto translation you are after,
but you should be able to /reference/ protogen.exe and use the
ProtoBuf.CodeGenerator.CommandLineOptions class (use
CommandLineOptions.Parse if you want to use the same argument handling,
otherwise set the properties manually - then call .Execute).

At the moment there is not, as far as I remember, an option to import .proto
from the xml version, purely because that xml only exists as an
artefact/implementation-detail of how it performs the code generation (it
could be added if there was a good reason). It won't /arbitrarily/ import
xml, and doesn't accept xsd etc.

I think, however, it would be a good idea to step back from these details,
and simply describe /what you have/, and /what you want it to do/... At the
moment I don't fully understand your context or intent, so it is impossible
to give a complete answer.

Marc


On 3 November 2010 07:55, Ofir Ben-Ezra <ofir.bene...@gmail.com> wrote:

> And another question:
> Is the above (conversion from XML <-> .proto) available in API
> (instead of using the protogen.exe)?
> Thanks,
> Ofir
>
> On Nov 3, 9:38 am, Ofir Ben-Ezra <ofir.bene...@gmail.com> wrote:
> > Thanks Marc.
> > What about the other direction -> converting from XML to .proto file?
> > How can I achieve that?
> > As for the 2nd question below I meant how can I generate C# classes
> > without using the protogen.exe (in code).
> > Thanks,
> > Ofir
> >
> > On Nov 3, 8:53 am, Marc Gravell <marc.grav...@gmail.com> wrote:
> >
> >
> >
> > > Speaking specifically to protobuf-net:
> >
> > > 1: there is no formal xml spec, and you should generally **only** need
> this
> > > for writing a template file, but passing -t:xml to protogen should do
> what
> > > you ask
> >
> > > 2: do you mean without using the plugin? There is a command-line tool
> > > "protogen" included in the zip
> >
> > > Marc
> >
> > > On 2 November 2010 12:06, Ofir Ben-Ezra <ofir.bene...@gmail.com>
> wrote:
> >
> > > > Hi,
> > > > I'm rather new to protocol buffers and to protobuf-net.
> > > > I have 2 questions:
> > > > 1. I'm trying to find out how can I generate XML file from a
> > > > given .proto file and vice versa?
> > > > 2. I know this is done automatically in VS2008 plug in, but how can I
> > > > generate C# classes from a given .proto file?
> > > > Thanks,
> > > > Ofir
> >
> > > > --
> > > > You received this message because you are subscribed to the Google
> Groups
> > > > "Protocol Buffers" group.
> > > > To post to this group, send email to proto...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > protobuf+unsubscr...@googlegroups.com<protobuf%2bunsubscr...@googlegroups.com>
> <protobuf%2bunsubscr...@googlegroups.c­om>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/protobuf?hl=en.
> >
> > > --
> > > Regards,
> >
> > > Marc- Hide quoted text -
> >
> > > - Show quoted text -- Hide quoted text -
> >
> > - Show quoted text -
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to proto...@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com<protobuf%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>
>


-- 
Regards,

Marc

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@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.

Reply via email to