protobuf-to-xsd is XSLT transformation to convert FileDescriptorSet
protocol buffer to XSD schema with requirements (see xsd-attributes.xslt):
- use XML attributes for simple types (like strings)
- correct handling of
required
andoptional
for attributes withuse="required"
anduse="optional"
XSD attributes - correct handling of
optional
for elements withminOccurs="0"
attribute - specify elements in any order (using
<xs:all />
instead of common<xs:sequential />
) - correct handling of
repeated
withmaxOccurs="unbounded"
It is based on protogen
utility written by Marc Gravell.
Try it out with simple command:
protogen.exe -i:descriptor.proto -o:descriptor.xsd -t:xsd-attributes -d
Set your protocol buffer message definition file instead of descriptor.proto
.
xsd-attributes.xslt is distributes under MIT license, see license text inside file.
protogen is distributed under Apache License, Version 2.0.
The core Protocol Buffers technology is provided courtesy of Google.